字符串类型不允许(在textColor上,值为'黑色'):Android Studios

时间:2017-10-27 08:19:27

标签: android

enter image description here

我使用Android工作室相当新。  尝试调整颜色时出现以下错误

2 个答案:

答案 0 :(得分:0)

您需要使用@android:color/black或提供十六进制颜色代码值

答案 1 :(得分:0)

试试这个

 <TextView
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:textColor="@color/colorAccent"/>

或者

<TextView
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:textColor="#ff00"/>

或者

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textColor="@android:color/black"/>