错误字符串类型不允许

Error String types not allowed

抱歉,我是初学者,当我构建应用程序时它向我显示错误

不允许字符串类型(在 'android:text Color Primary' 处,值为 'TITLE_COLOR_GOES_HERE')。

如果你想使用一些颜色,有两种方法:

要么直接用colorcode

yourTextView.setTextColor(Color.RED);

或者您可以在 colors.xml 资源文件中定义一些颜色并使用它 yourTextView.setTextColor(colors.red);

设置颜色时,您需要在资源文件夹 (res) 的 colors.xml 文件中将该颜色名称定义为字符串,或者使用类似 Color.RED 或您喜欢的颜色