1.在xml文件中引用
android:textColor="@color/tv_top_title_color"
2.在代码中引用
1)在color.xml中定义
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="dialog_text_color_pressed">#b54cff</color> <color name="dialog_text_color_normal">#323232</color> </resources>
2)在代码中引用
holder.mDialogText.setTextColor(getResources().getColor(R.color.dialog_text_color_pressed));
时间: 2024-10-15 10:23:24