Custom Android switch track 'animation'
问题 I've created a basic custom Switch , as defined below. <Switch android:id="@+id/availSwitch" android:layout_width="wrap_content" android:switchMinWidth="110dp" android:layout_height="wrap_content" android:track="@drawable/switch_track" android:thumb="@drawable/thumb"/> The @drawable/thumb is a simple PNG which works fine. The @drawable/switch_track is defined below. @drawable/trackon and @drawable/trackoff are PNG's. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item