我希望能够改变一个紧凑型拇指开关的文本大小,但是我遇到了困难。
以下是我的布局:
<android.support.v7.widget.SwitchCompat
android:id="@+id/switch_compat2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:checked="true"
android:switchTextAppearance="@style/MyStyle"
android:text="SwitchCompat (SDK v7+)"
app:showText="true" />
并且样式:
<style name="MyStyle">
<item name="android:textColor">#229922</item>
<item name="android:textSize">10sp</item>
</style>
然而,无论我在"MyStyle"上做什么,Switch(开关)始终是这个样子:
理想情况下,我希望它看起来像这样:
有人愿意分享他们的drawables,这样我可以尝试匹配上面的图片吗?
我正在查阅这些线程,但并没有正确匹配。它让它看起来更糟。
谢谢!