मैं एक कस्टम संवाद बनाने की कोशिश कर रहा हूं, और इसकी सामग्री केंद्रित है, लेकिन यह हमेशा बाएं-गठबंधन को समाप्त कर रहा है। यहाँ aboutdialog.xml है:एंड्रॉइड संवाद के अंदर लेआउट कैसे केंद्रित करें?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="vertical"
a:id="@+id/AboutDialogLayout"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_gravity="center_horizontal"
a:gravity="center_horizontal">
<ImageView a:id="@+id/imageView1"
a:src="@drawable/pricebook"
a:layout_height="wrap_content"
a:layout_width="wrap_content"/>
<TextView a:layout_height="wrap_content"
a:textAppearance="?android:attr/textAppearanceLarge"
a:id="@+id/textView1"
a:text="Price Book"
a:layout_width="wrap_content"/>
<TextView a:layout_height="wrap_content"
a:id="@+id/textView2"
a:layout_width="wrap_content"
a:text="foo"/>
</LinearLayout>
और मेरे (प्रासंगिक) कोड:
Dialog d = new Dialog(this);
d.setContentView(R.layout.aboutdialog);
d.setTitle(R.string.app_name);
क्या मैं यहाँ याद आ रही है? सहायता के लिए धन्यवाद।
छवि:
यह अजीब है। यह मेरे लिए ठीक काम करता है। क्या आप स्क्रीनशॉट पोस्ट कर सकते हैं? – inazaruk
+1 का उपयोग करने के लिए +1: एंड्रॉइड के बजाए: हर जगह, आपने यह कैसे किया? –
हां, मैं भी इसे अपने कामकाजी जुर्माना की जांच करता हूं। –