Selection Box around android.support.v7.widget.SwitchCompat
Asked Answered
D

1

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?

Downall answered 17/1, 2015 at 12:45 Comment(0)
D
20

Use:

<android.support.v7.widget.SwitchCompat 
    ...
    android:background="@null" />
Dihybrid answered 17/1, 2015 at 12:47 Comment(1)
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.Loan

© 2022 - 2024 — McMap. All rights reserved.