public void onClick(View v) {
View someView = findViewById(R.id.activity_success);
View root = someView.getRootView();
// what should be written here?? to display color
txtA.setBackgroundColor(getResources().getResourceTypeName(???));
的应用等拍摄。如何改变活动的背景色上的按钮,点击其中的颜色从单选按钮
我们,并点击适用于背景与颜色选择和radioButton1
红颜色显示在多行文本区域的点击不同的单选按钮,该颜色则适用于整个活动的背景。
现在问题是getResource()
中给出的代码应该是什么,以便它从每个RadioButton
中选取颜色以将其应用于活动背景。 。
你能否提供更多的代码?你的问题不清楚,你的代码不足以理解你正在尝试的。 –