在string.xml文件中,我使用以下标记
<string name="CodeColor" >"#0000ff"</string>
Run Code Online (Sandbox Code Playgroud)
如果我使用
textview1.setTextColor(Color.RED);
Run Code Online (Sandbox Code Playgroud)
它有效,但是当我使用时
textview1.setTextColor(TextViewStyles.this.getResources().getColor(R.string.CodeColor));
or
textview1.setTextColor(R.string.CodeColor);
Run Code Online (Sandbox Code Playgroud)
它不起作用.有什么建议...
提前致谢