setCardBackgroundColor() 设置错误的颜色

setCardBackgroundColor() set wrong color

我正在尝试使用函数 setCardBackgroundColor() 以编程方式设置 CardView 的颜色,但颜色显示不正确。

确保您没有发送颜色的 ID(即 R.color.COLOR_NAME)