我在 Android 中为 CardView 设置了一个随机颜色。
Random rnd = new Random();
int color = Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
holder.cardView.setBackgroundColor(color);
Run Code Online (Sandbox Code Playgroud)
如何以编程方式在运行时获取 Cardview 背景颜色?