Issue
I created custom drawable for Switch
but when I apply it to switch item using android:drawableRight="@drawable/switch_selector"
it looks like this:
How to get rid of those default view? Can anyone help me? Thanks in advance!
Solution
For an Android Switch you need to set the Drawables for each of the parts. The first part is the android:thumb
which is the Drawable that moves from left to right.
The second part is the
android:track
which is the Drawable that the android:thumb
slides on. If you do not mind having no animations you can set the
android:thumbTint="@color/transparent
and the android:trackTint="@color/transparent
which will remove the default view.
Answered By - KevinZ
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.