android - How to make Switch button in Adroid fill width in TableRow -
i need use switch need fill tablerow, half on , half off.
how achieve that? tried lots of combinations no success.
i have:
<tablerow android:id="@+id/tablerow6" android:layout_width="fill_parent" android:layout_height="wrap_content" > <switch android:id="@+id/switchstatus" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="start" android:checked="false" android:switchminwidth="56dp" android:textoff="ocupado" android:texton="livre" android:thumb="@drawable/switch_bg" android:track="@drawable/track_bg" />
resulting screen (is set on):
changing to:
<tablerow android:id="@+id/tablerow6" android:layout_width="fill_parent" android:layout_height="wrap_content" > <switch android:id="@+id/switchstatus" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="start" android:checked="false" android:switchminwidth="56dp" android:textoff="ocupado" android:texton="livre" android:thumb="@drawable/switch_bg" android:track="@drawable/track_bg" />
resulting screen:
make width of switch match_parent
try this
<switch android:id="@+id/switchstatus" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="start" android:checked="false" android:switchminwidth="56dp" android:textoff="ocupado" android:texton="livre" android:thumb="@drawable/switch_bg" android:track="@drawable/track_bg" />
Comments
Post a Comment