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): enter image description here

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: enter image description here

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

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -