Android SwitchCompat folder not aligned

I am trying to use SwitchCompatin Android Studio, I put this in build.gradle:

compile 'com.android.support:appcompat-v7:21.+'

but the thumb is not centered with the slider.

Screen shot

and this is my xml:

<android.support.v7.widget.SwitchCompat
    android:id="@+id/allarme"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dp"
    android:layout_gravity="right" />

Can you help me?

+4
source share
1 answer

I finally found a problem: there is an error in appcompat (v21.0.3 at the moment) that affects hdpi devices. More details there: https://code.google.com/p/android/issues/detail?id=78262

workaround: copy this file to res / drawable-hdpi of your application: https://www.mediafire.com/?6c7537yi73m1e6m

0
source

All Articles