Q:

Custom dialog without title is messing my layout up

I am trying to create a custom dialog without the title bar and I following SO suggestion by doing the following
propDiag = new Dialog(this);
propDiag.requestWindowFeature(Window.FEATURE_NO_TITLE);
propDiag.setContentView(R.layout.property_daig);

Here is a part of my xml
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:background="@drawable/background"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:orientation= "horizontal">
        <LinearLayout android:layout_width="wrap_content"
            android:layout_height="fill_parent" android:orientation= "vertical" android:layout_weight="1" >

                   //COUPLE OF buttons

        </LinearLayout>
        <View android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.5" ></View>
        <LinearLayout android:layout_width="wrap_content"
            android:layout_height="fill_parent" android:orientation= "vertical"  android:layout_weight="1"  >
                       //COUPLE OF buttons
            </LinearLayout>
    </LinearLayout>

The problem that it is messing up my layout and everything gets pushed to max right and left
When I do it without the requestWindowFeature, then everything is great except for the title appearing!. 
Can anyone explain and recommend a solution?
Thanks

A:

See below code:
I don't have your background image, but just have put the icon image and execute the below code.
Also have attached the screen shot of the output.
Code:
 Button test = (Button) findViewById(R.id.button1);

    test.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
             final Dialog dialog = new Dialog(MainActivity.this);
             dialog.getWindow();
             dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
             dialog.setContentView(R.layout.property_daig);

             dialog.show();

        }

    });

Output:

Hope it will help you.
Enjoy Coding. :)

