क्यू 1। आप को बढ़ाने के लिए या अनुकूलित और एक शैली बना सकते हैं और कैसे आप एक लेआउट बढ़ AlertDialog
यहाँ करने के लिए लागू करते हैं और AlertDialog
पर लागू
LayoutInflater li = LayoutInflater.from(ctx);
View view = li.inflate(R.layout.formatted_dialog, null);
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
builder.setTitle("Formatted");
builder.setView(view);
सभी स्वरूपण और लेआउट आपके द्वारा निर्दिष्ट में आवश्यक शैलियों को परिभाषित किया है।
आप विशिष्ट TextView लेआउट में परिभाषित का उपयोग कर सकते का उपयोग कर देखें अर्थात
LayoutInflater li = LayoutInflater.from(ctx);
View view = li.inflate(R.layout.formatted_dialog, null);
TextView label=(TextView)view.findViewById(R.id.i_am_from_formatted_layout_lable);
Q2 फुलाया। android:textColorLink="#FF00FF"
का उपयोग लिंक के रंग को निर्दिष्ट करने के लिए किया जा सकता है।
संपादित करें:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="http://www.google.com"
android:autoLink="web"
android:textColorLink="#FF00FF"
/>
</LinearLayout>
अपने onCreate में() या या जहां जब भी आप AlertDialog
LayoutInflater li = LayoutInflater.from(this);
View view = li.inflate(R.layout.link, null);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Formatted");
builder.setView(view).create().show();
TextView text=(TextView) findViewById(R.id.text);
कॉल करना चाहते हैं:
नमूना लेआउट के रूप में रेस/लेआउट/link.xml बचाया आप किसी अन्य विधि से बुला रहे हैं, तो
संदर्भ वस्तु के साथ this
बदलें।
मैं कुछ संदेह है। Formatted_dialog लेआउट कैसे होगा? तो मुझे अपनी सामग्री कैसे जोड़नी चाहिए? और मुझे 'android: textColorLink' कहां निर्दिष्ट करना चाहिए? – Vivek
नमूना जोड़ा गया। उम्मीद है कि यह आपको स्पष्ट विचार देगा। – Shardul
क्या आप मुझे बता सकते हैं कि अलर्टडियलॉग –