4

我正在尝试SwitchCompat在 Android Studio 中使用,我把它放在 build.gradle 中:

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

但拇指不在滑块的中心。

截屏

这是我的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" />

你能帮我么?

4

1 回答 1

0

我终于找到了问题:appcompat(目前是v21.0.3)中有一个影响hdpi设备的错误。更多:https ://code.google.com/p/android/issues/detail?id=78262

解决方法:将此文件复制到应用程序的 res/drawable-hdpi 中:https ://www.mediafire.com/?6c7537yi73m1e6m

于 2015-02-24T17:33:50.837 回答