12

I am trying to mimic the new material design switch in my app and the switchcompat works pretty well. The only problem is a grey selection box appears around the switch on touch and really takes away from the clean look. Is this something I can remove?

grg
  • 5,023
  • 3
  • 34
  • 50
Zander B
  • 247
  • 3
  • 15

1 Answers1

20

Use:

<android.support.v7.widget.SwitchCompat 
    ...
    android:background="@null" />
natario
  • 24,954
  • 17
  • 88
  • 158
  • 2
    It should be noted that doing this removes some of the "Material Design-ness" on Android 5.x devices. It's probably best to encapsulate this in a style and use a styles-v21.xml that does not null the background to guarantee that your UI looks its best on Android 5.x. – jdonmoyer Feb 20 '15 at 16:18