就用这个
view.setTextColor(activity.getResources().getColor(R.color.white));
view.setTextColor(activity.getResources().getColor(R.color.red));
view.setTextColor(activity.getResources().getColor(R.color.green));
并剃须颜色值res/values/colors.xml
colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white">#fff</color>
<color name="red">#DF1111</color>
<color name="green">#63DF11</color>
</resources>
在 Widget 中试试这个
Widget.setBackgroundColor(Color.RED);
和这个
remoteView.setInt(R.id.message, "setBackgroundColor" android.graphics.Color.BLACK);