<ToggleButton
android:id="@+id/switchitem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/toggle"
android:checked="true"
android:textOn=""
android:textOff=""/>
and the drawable will be :
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/toggle_me_on" /> <!-- pressed -->
<item android:drawable="@drawable/toggle_me_off" /> <!-- default/unchecked -->
</selector>
No comments:
Post a Comment