title: Android AlertDialog not centering/scaling vertically
body: <p>I'm building an AlertDialog that contains a custom View like so:</p>
  <pre class="lang-java prettyprint-override"><code>@Override
  protected Dialog onCreateDialog(int id) {
      switch (id) {
          case DIALOG_INTRO:
              // setup the dialog
              AlertDialog.Builder builder = new AlertDialog.Builder(this);
              View inflatedLayout = ((LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE)).inflate(R.layout.intro, null);
              builder.setView(inflatedLayout);
  
              // return the dialog
              return builder.create();
      }
  
      return super.onCreateDialog(id);
  }
  </code></pre>
  <p>And the layout XML:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;ScrollView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;  
      android:layout_width=&quot;match_parent&quot; 
      android:layout_height=&quot;match_parent&quot;
      android:background=&quot;#000000&quot;&gt;
  
      &lt;TableLayout 
          android:layout_height=&quot;match_parent&quot; 
          android:layout_width=&quot;match_parent&quot;
          android:stretchColumns=&quot;2&quot;
          android:shrinkColumns=&quot;1&quot;&gt;
      
          &lt;TableRow&gt;
              &lt;TextView 
                  android:id=&quot;@+id/intro_TextView_title&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_span=&quot;2&quot;
                  android:gravity=&quot;center&quot;
                  android:text=&quot;@string/intro_title&quot;
                  android:textSize=&quot;22sp&quot; 
                  android:textColor=&quot;#FFFFFF&quot; /&gt;
          &lt;/TableRow&gt;
      
          &lt;TableRow
              android:layout_marginTop=&quot;20dip&quot; &gt;
              &lt;ImageView 
                  android:layout_height=&quot;wrap_content&quot; 
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_marginLeft=&quot;25dip&quot;
                  android:layout_marginRight=&quot;25dip&quot;
                  android:paddingTop=&quot;2dip&quot;
                  android:src=&quot;@drawable/intro_add&quot; /&gt;
              &lt;TextView 
                  android:id=&quot;@+id/intro_TextView_add&quot;
                  android:layout_width=&quot;wrap_content&quot; 
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginRight=&quot;20dip&quot;
                  android:text=&quot;@string/intro_add&quot; 
                  android:textColor=&quot;#FFFFFF&quot; /&gt;
          &lt;/TableRow&gt;
  
          &lt;!-- ... --&gt;
  
      &lt;/TableLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  <p>That gives me a dialog that looks something like this (details blurred, sorry):</p>
  <p><img src="https://i.stack.imgur.com/CTY03.png" alt="blurred AlertDialog screenshot" /></p>
  <p>The problem is that big gap at the top (above the dialog). Is there anything I can do to either get rid of it or make the bottom have a similar gap?</p>