I created a custom theme that inherits from "Theme.Holo.Light.Dialog".
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="cust_dialog" parent="@android:style/Theme.Holo.Light.Dialog"> </style> </resources>
My code is:
private AlertDialog testDialog; AlertDialog.Builder testBuilder; LayoutInflater inflater = (LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.test_dialog, (ViewGroup) findViewById(R.id.test_root)); testBuilder = new AlertDialog.Builder(this, R.style.cust_dialog); testBuilder.setView(layout); testBuilder.setTitle("Support"); testDialog = testBuilder.create(); testDialog.show();
This causes my dialog to be in the dialog box. How to fix it?
Thanks.
EDIT ::
This is my test_dialog.xml layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/test_root" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:id="@+id/test1" android:layout_width="300dp" android:layout_height="75dp" android:text="@string/test" android:gravity="center" /> <Button android:id="@+id/test2" android:layout_width="300dp" android:layout_height="75dp" android:text="@string/test" android:layout_below="@id/test1" android:gravity="center" /> </RelativeLayout>
CLDev source share