2017-05-10 56 views

回答

1

只要把你的RGB码本网站http://www.rgbtohex.net/并与十六进制代码(以#开头的那个)使用方法:

button.setBackgroundColor(Color.parseColor(hexcodefromwebsite)); 
0
Button button = (Button)findViewById(R.id.YOUR_BUTTON_ID); 

button.setBackground(R.color.YOUR_COLOR_RESOURCE);

+0

谢谢,我还有一个问题:我怎么能使用的值设置颜色RG和B? – EmLe49