Closed start141 closed 8 years ago
以下是一种复现方式
<com.kyleduo.switchbutton.SwitchButton android:id="@+id/sb_custom_miui" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_centerVertical="true" android:layout_alignParentRight="true" app:kswBackDrawable="@drawable/miui_back_drawable" app:kswBackMeasureRatio="2" app:kswThumbDrawable="@drawable/miui_thumb_drawable" app:kswThumbHeight="18dp" app:kswThumbWidth="18dp" />
Android Studio AVD选Nexus 5x
预览效果是(注意右侧缺了一块)
能否同时给下parent的xml?
parent是RelativeLayout,没有别的,不会影响到这个问题的,上面的例子选nexus 5可以显示完整。 或者调整kswBackMeasureRatio,有些值可以显示完整有些显示不完整,猜测应该是控件的宽度计算有误差(或许是某些情况下少算了一个像素)
确实是宽度计算有误差,很快会更新一个版本。感谢
以下是一种复现方式
Android Studio AVD选Nexus 5x
预览效果是(注意右侧缺了一块)