[英]Android SwitchCompat thumb not aligned
I'm trying to use SwitchCompat
in Android Studio, I put this in build.gradle: 我正在尝试在Android Studio中使用
SwitchCompat
,我把它放在build.gradle中:
compile 'com.android.support:appcompat-v7:21.+'
but the thumb is not centered with the slider. 但是拇指没有滑块居中。
and this is my xml: 这是我的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 please help me? 你能帮我么?
I finally found the problem: there is a bug in appcompat (v21.0.3 at the moment) that afflict hdpi devices. 我终于找到了问题:appcompat(目前是v21.0.3)中存在一个问题,它会影响hdpi设备。 More there: https://code.google.com/p/android/issues/detail?id=78262
更多信息: https : //code.google.com/p/android/issues/detail?id = 78262
workaround: copy this file in res/drawable-hdpi of your app: https://www.mediafire.com/?6c7537yi73m1e6m 解决方法:将此文件复制到应用的res / drawable-hdpi: https ://www.mediafire.com/?6c7537yi73m1e6m
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.