title: Custom View using onCreateView in a DialogFragment
body: <p>Been trying to figure this out for a while now:</p>
  
  <p>I'm trying to create a custom dialog using the standard approach shown on the <a href="http://developer.android.com/reference/android/app/DialogFragment.html" rel="nofollow noreferrer">Dev site</a>.</p>
  
  <pre><code>public class CustomDialog extends DialogFragment {    
      private OnDialogResultListener mOnDialogResultListener = null;
      public void setOnDialogResultListener(OnDialogResultListener dialogResultListener) {
          mOnDialogResultListener = dialogResultListener;
      }
  
      public static CustomDialog newInstance(OnDialogResultListener dialogResultListener) {
          CustomDialog frag = new CustomDialog();        
          frag.setOnDialogResultListener(dialogResultListener);
          return frag;
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          getDialog().setTitle(getString(R.string.Dialog_CustomDialog_Title));
          View v = inflater.inflate(R.layout.customdialog, container, false);
          return v;
      }
  }
  </code></pre>
  
  <p>With the XML being:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_height="fill_parent" android:background="@color/white" android:layout_margin="0px" android:layout_width="fill_parent"&gt;
      &lt;EditText android:hint="@string/Dialog.CustomDialog.OldPassword" android:layout_marginBottom="@dimen/normalMargin" android:layout_height="wrap_content" android:inputType="textPassword" android:id="@+id/EditText02" android:layout_width="fill_parent"&gt;&lt;/EditText&gt;
      &lt;EditText android:hint="@string/Dialog.CustomDialog.NewPassword" android:layout_height="wrap_content" android:inputType="textPassword" android:id="@+id/EditText01" android:layout_width="fill_parent"&gt;&lt;/EditText&gt;
      &lt;EditText android:hint="@string/Dialog.CustomDialog.RetypePassword" android:layout_height="wrap_content" android:inputType="textPassword" android:id="@+id/editText1" android:layout_width="fill_parent"&gt;
          &lt;requestFocus&gt;&lt;/requestFocus&gt;
      &lt;/EditText&gt;
      &lt;LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_width="fill_parent"&gt;
          &lt;Button android:layout_height="wrap_content" android:text="@string/save" android:layout_width="@dimen/normalButtonWidth" android:id="@+id/btn_Custom_save"&gt;&lt;/Button&gt;
          &lt;Button android:layout_height="wrap_content" android:text="@string/cancel" android:layout_width="@dimen/normalButtonWidth" android:id="@+id/btn_Custom_cancel"&gt;&lt;/Button&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And after creating and showing the dialog, I'm left with:
  <img src="https://i.stack.imgur.com/Vonnj.png" alt="enter image description here"></p>
  
  <p>The white background has been applied to emphasize the unexpected and unwanted behavior.</p>
  
  <p>Any ideas? I've tried changing width/heights, using weights in a horizontal LinearLayout, setting width/height programatically - all to no avail.</p>