title: Size of button in tablerow is not correct. (Android)
body: <p>I'm writing an Android application. Here is it's XML layout :</p>
  
  <pre><code> &lt;ScrollView android:id="@+id/ScrollView01"
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent"  
          android:layout_gravity="left|top|bottom|right"
          android:layout_marginTop="80dip"
          android:layout_marginLeft="0dip"
          android:layout_marginRight="0dip"
          android:layout_marginBottom="60dip"
  
  &gt;
  
       &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/centerlayout"
      android:orientation="vertical"
      android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          android:layout_gravity="left|right|top|bottom"
          android:layout_marginRight="20dip"
          android:layout_marginLeft="10dip"
          android:layout_marginBottom="120dip"    &gt;
  
      &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      &gt;
  
  
  
      &lt;TableRow&gt;
           &lt;Button android:text="Button" 
               android:layout_column="0"
              android:id="@+id/bookmarkbutton" 
              android:layout_width="230dip" 
              android:layout_height="30dip" 
  
              android:background="@drawable/red_btn"
              android:padding="14dp" 
             &gt;&lt;/Button&gt;
  
  
      &lt;/TableRow&gt;
  
  
      &lt;/TableLayout&gt;
  
     &lt;/LinearLayout&gt;
  
  
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>and if I run it, it displays the following screen:
  <img src="https://i.stack.imgur.com/7T7Kn.png" alt="enter image description here"></p>
  
  <p>But when I add android:layout_gravity="left" to the "Button", the button size decreases and shows :
  <img src="https://i.stack.imgur.com/IciEc.png" alt="enter image description here"></p>
  
  <p>Please note if I change the width of button by android:layout_width="30dip", it shows small buttons,
  <img src="https://i.stack.imgur.com/Dmgdh.png" alt="enter image description here"></p>
  
  <p>but If I change it to bigger sizes, it does not apply the size correctly and the max width is the same as second image.</p>
  
  <p>Finally If I add a new textview to it, via</p>
  
  <pre><code>ScrollView android:id="@+id/ScrollView01"
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent"  
          android:layout_gravity="left|top|bottom|right"
          android:layout_marginTop="80dip"
          android:layout_marginLeft="0dip"
          android:layout_marginRight="0dip"
          android:layout_marginBottom="60dip"
  
  
  
  &gt;
  
           &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/centerlayout"
          android:orientation="vertical"
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          android:layout_gravity="left|right|top|bottom"
          android:layout_marginRight="20dip"
          android:layout_marginLeft="10dip"
          android:layout_marginBottom="120dip"
  
  
          &gt;
  
      &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      &gt;
  
  
  
    &lt;TableRow&gt;
           &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/subjecttext"
          android:layout_width="wrap_content"  
          android:layout_height="wrap_content"
          android:lineSpacingExtra="10dip"
          android:padding="14dp" 
          /&gt;    
          &lt;/TableRow&gt;
  
      &lt;TableRow&gt;
           &lt;Button android:text="Button" 
               android:layout_column="0"
              android:id="@+id/bookmarkbutton" 
              android:layout_width="20dip" 
              android:layout_height="30dip" 
              android:background="@drawable/black_btn"
              android:padding="14dp" 
             &gt;&lt;/Button&gt;
  
  
      &lt;/TableRow&gt;
  
  
  
  
  
  &lt;/TableLayout&gt;
  
          &lt;/LinearLayout&gt;
  
  
  
          &lt;/ScrollView&gt;
  </code></pre>
  
  <p>It displays the following image, and the size of button no longer is changeable.  Would you please tell me what's wrong?</p>
  
  <p><img src="https://i.stack.imgur.com/YTLv1.png" alt="enter image description here"></p>