android - How to change the height of a switch widget? -
i want have switch widget larger , have change height of switch.
but have no solution this.
i looked @ question: change height of switch
and made drawable this:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:width="0dp" android:height="30dp"> <solid android:color="#ff4444" /> </shape>
then setted switch this:
<switch android:id="@+id/sw_tracklivedata" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/tv_livedata" android:layout_alignright="@+id/btn_stoptrip1" android:layout_alignleft="@+id/btn_stoptrip1" android:layout_margintop="10dp" android:thumbtextpadding="25dp" android:switchminwidth="56dp" android:track="@drawable/roundedbutton" android:layout_centerhorizontal="true" android:textsize="20dp" />
but doesnt work. wrong. can give me example how right? or can guide me through this?
change roundedbutton.xml that:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <size android:height="20dp" android:width="56dp" /> <solid android:color="#ff4444" /> </shape>
Comments
Post a Comment