0
下面的代码将背景颜色更改为黑色,无论我以何种颜色通过 参数。如何在运行时在Android中更改Button的BackgroundColor?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
b = (Button)findViewById(R.id.Button01);
b.setBackgroundColor(R.color.red);
}
任何帮助?