请问如何能获取android按钮背景的颜色?

[复制链接]
查看11 | 回复4 | 2012-4-13 15:37:22 | 显示全部楼层 |阅读模式
也许你可以重写一下这个View里的setBackgroundColor();private int mBgColor = 0;@Overridepublic void setBackgroundColor(int color){
mBgColor = color;
super.setBackgroundColor(color);}public int getBackgroundColor(){
return mBgColor;}...
回复

使用道具 举报

千问 | 2012-4-13 15:37:22 | 显示全部楼层
设置了背景颜色 但是现在我想要获取按钮的背景颜色该用那个方法啊 mButton.getBackground(); 是要得到这个么? ,...
回复

使用道具 举报

千问 | 2012-4-13 15:37:22 | 显示全部楼层
设置了背景颜色 但是现在我想要获取按钮的背景颜色该用那个方法啊 mButton.getBackground(); 是要得到这个么? ,...
回复

使用道具 举报

千问 | 2012-4-13 15:37:22 | 显示全部楼层
可以在Button里面 加 android:background="颜色代码", 但是有个问题是这样Button的大小就改变了 变窄了 我也在这纠结这问题呢...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行