android - 应用样式后,SwitchMaterial 不会更改 textStyle
问题描述
代码:
分段:
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/changeDateFormatSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="@string/timeFormat"
android:theme="@style/switchText"
app:layout_constraintEnd_toEndOf="@+id/timePicker"
app:layout_constraintStart_toStartOf="@+id/timePicker"
app:layout_constraintTop_toBottomOf="@+id/timePicker"
app:switchTextAppearance="@style/switchText" />
主题:
(如您所见,我尝试了很多东西……但没有一个奏效……但是?)
<style name="switchText">
<item name="android:textColor">@color/gold</item>
<item name="android:textColorPrimary">@color/gold</item>
<item name="android:editTextColor">@color/gold</item>
<item name="colorControlNormal">@color/gold</item>
<item name="colorControlActivated">@color/gold</item>
</style>
任何想法我应该改变什么来改变:
文字颜色?
提前致谢 :)
解决方案
推荐阅读
- java - 导致 ERROR 递归调用 appender。有没有办法解决它?
- node.js - 错误:(节点:13452)UnhandledPromiseRejectionWarning:TypeError:message.guild.roles.cache.find 不是函数
- java - 是否可以为 freemarker 模板应用自定义字体
- html - 将 SVG 标记导出为 HTML 网页中的图像
- javascript - PUT 表单数据 axios vue.js
- bluetooth - 蓝牙连接超时
- java - java - 如何在java ee中单击按钮时从列表中添加特定项目?
- avro - 如何在另一个 Avro 类型中使用 Avro 类型,而无需再次定义它?
- javascript - 如何在数字的开头添加一个+号,该数字应该不可编辑并与数字一起传递?
- wireguard - Wireguard 端口号