1

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?

Boy
  • 7,010
  • 4
  • 54
  • 68
  • Why not putting `text` next to `switch`? To ahieve what you want you can use your own image with `9patch` maybe. Switches on lolipop dont include text and it is suggested to stick to that rule for a better `UX` – hrskrs May 22 '15 at 06:45
  • Yeah, probably a better way to go. But as the switch supports it, I expect it to show up correctly. Customer wanted this, so...maybe I should try to get the holo switch in 5.0... – Boy May 22 '15 at 09:39

1 Answers1

1

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.

BrantApps
  • 6,362
  • 2
  • 27
  • 60