xml - Can't change button width in Eclipse (android) -


check out button12s below. is button has text "go" button wide. want wide text.
nested inside table if matters.

        <tablerow             android:id="@+id/tablerow1_1"             android:layout_width="fill_parent"             android:layout_height="wrap_content" >              <checkbox                 android:id="@+id/checkbox25"                 android:layout_width="fill_parent"                 android:layout_height="25dp"                 android:text="@string/_3x12s" />              <button                 android:id="@+id/button12s"                 android:minheight="1dp"                 android:minwidth="1dp"                 android:onclick="starttimer"                 android:text="@string/_go" /> 

link image (i can't embed yet): http://i.stack.imgur.com/nvfl7.png

android:minwidth="1dp" cause fill row.

use android:layout_width="wrap_content" make tightly fit around word.

a layout might want

<tablerow     android:id="@+id/tablerow1_1"      android:layout_width="fill_parent"      android:layout_height="wrap_content" >     <linearlayout android:layout_width="fill_parent"                   android:layout_height="wrap_content"                   android:orientation="horizontal"                   android:layout_weight="1"                   >         <checkbox                 android:id="@+id/checkbox25"                 android:layout_width="wrap_content"                 android:layout_height="25dp"                 android:text="3x12s" />         <button                 android:id="@+id/button12s"                 android:layout_width="wrap_content"                 android:layout_height="25dp"                 android:paddingleft="10dp"                 android:layout_marginleft="10dp"                 android:paddingright="10dp"                 android:layout_marginright="10dp"                 android:onclick="starttimer"                 android:background="@color/grey"                 android:text="go" />     </linearlayout>     <checkbox             android:id="@+id/checkbox30"             android:layout_weight="1"             android:layout_width="fill_parent"             android:layout_height="25dp"             android:text="5reps" /> </tablerow> 

but recommend making rows bigger 25dp showed in sample, hard button press.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -