F
F
furyon2015-10-24 23:44:47
Android
furyon, 2015-10-24 23:44:47

How to set ripple for Switch?

Hello!
I'm trying to make a ripple effect for switch:

<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#ccc">
    <item android:drawable="@android:color/white"/>
</ripple>

and for switch I specify
<Switch
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/ripple_highlight"
    android:text="bla bla bla"/>

But it does not work as I expected, the center of the effect is always in the place where the switch is located, and not where it was touched with a finger. It turns out you press in one place and the effect is in another, and in 5m and 6m androids it looks different but still wrong.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question