Search code examples
androidswitchcompat

Lollipop switch with text does not look good


I am trying to have a yes/no switch in Lollipop. The Holo Switch actually does this nice. But this is what it looks like on my device:

enter image description here

How can I make the button background scale with it? I tried settings a different background (thumb), but that one got cut off. Added padding somewhat fixed it, but hey, this should not be something I need to fiddle around with to get to work..doing that is my backup plan if no-one has an answer here ;)

Someone any ideas?


Solution

  • Just came to a similar conclusion. Based on my readings around how the new Switch / android.support.v7.widget.SwitchCompat widgets should be used it appears that the right thing to do here is to adjust design to fit with Lollipop or move widget type to radio buttons if appropriate.