【问题标题】:I am using this layout and want to change the color of text and checkbox to white我正在使用此布局并希望将文本和复选框的颜色更改为白色
【发布时间】:2017-04-07 22:11:56
【问题描述】:

我正在使用此布局并想将文本和复选框的颜色更改为白色,我尝试添加属性 'android:textcolor' 但没有任何更改

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="?android:attr/listPreferredItemHeightSmall"
    android:textAppearance="?android:attr/textAppearanceListItemSmall"
    android:gravity="center_vertical"
    android:checkMark="?android:attr/listChoiceIndicatorMultiple"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" />

【问题讨论】:

标签: java android


【解决方案1】:

android:textColor="#ffffff" android:textColor="@color/white"

应该是工作格式白色。在我的机器上测试过,效果很好。

看来您可能忘记在 android:textColor 中将 C 大写

【讨论】:

    【解决方案2】:

    我的问题通过将代码复制并粘贴到新的 xml 文件来解决。由于我尝试添加颜色的前一个 xml 文件被锁定并且不允许我修改它的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-18
      • 2023-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-19
      • 2019-08-20
      相关资源
      最近更新 更多