Prevent Button Resizing When Text Is Too Long?
<p>I just wondered if it's possible to prevent a Button resizing when assigning long text to it.</p>

<p>I am wanting to place 2 rows of 4 buttons in my Layout but as soon as I change the text in one it automatically resizes squashing the others so nothing is evenly sized.</p>

<p>I've tried weight, weight sum, gravity but I have to admit my lack of understanding of these attributes!</p>

<p>This is my XML so far:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@+id/linearLayout1" 
    android:background="@drawable/backgroundrepeat" 
    android:orientation="vertical"
    android:weightSum="2"&gt;
    &lt;ScrollView android:id="@+id/scrollView1" 
        android:layout_height="wrap_content" 
        android:layout_width="match_parent" 
        android:layout_weight="2"&gt;
        &lt;TextView android:id="@+id/textView1" 
            android:layout_width="match_parent" 
            android:text="TextView" 
            android:layout_height="wrap_content"&gt;
        &lt;/TextView&gt;
    &lt;/ScrollView&gt;
    &lt;LinearLayout android:layout_height="wrap_content" 
        android:id="@+id/linearLayout3" 
        android:layout_width="match_parent" 
        android:layout_weight="1"
        android:weightSum="4.0"
        android:gravity="left"&gt;
        &lt;Button android:text="Button" 
            android:id="@+id/button1" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" android:layout_weight="1.0"&gt;
        &lt;/Button&gt;
        &lt;Button android:text="Button" 
            android:gravity="center"
            android:id="@+id/button2" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" android:layout_weight="1.0"&gt;
        &lt;/Button&gt;
        &lt;Button android:text="Button" 
            android:id="@+id/button3" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" android:layout_weight="1.0"&gt;
        &lt;/Button&gt;
        &lt;Button android:id="@+id/button4" 
            android:layout_height="wrap_content" 
            android:layout_width="wrap_content" 
            android:text="Button" android:layout_weight="1.0"&gt;
        &lt;/Button&gt;
    &lt;/LinearLayout&gt; 
    &lt;LinearLayout android:layout_height="wrap_content" 
        android:id="@+id/linearLayout3" 
        android:layout_width="match_parent" 
        android:layout_weight="1"
        android:weightSum="4.0"
        android:gravity="left"&gt;
        &lt;Button android:text="Button" 
            android:id="@+id/button5" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" android:layout_weight="1.0"&gt;
        &lt;/Button&gt;
        &lt;Button android:text="Button" 
            android:gravity="center"
            android:id="@+id/button6" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" android:layout_weight="1.0"&gt;
        &lt;/Button&gt;
        &lt;Button android:text="Button" 
            android:id="@+id/button7" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" android:layout_weight="1.0"&gt;
        &lt;/Button&gt;
        &lt;Button android:id="@+id/button8" 
            android:layout_height="wrap_content" 
            android:layout_width="wrap_content" 
            android:text="Button" android:layout_weight="1.0"&gt;
        &lt;/Button&gt;
    &lt;/LinearLayout&gt;          
&lt;/LinearLayout&gt;
</code></pre>
