本人在一个按钮点击事件之后改变这个按钮和另一个按钮的背景图片,但是改变背景之后,发现按钮上的文字不在了,问一下这是怎么回事?
btn_tiqu.setBackgroundResource(R.drawable.icon_rech_left_2);
btn_tiqu.setTextColor(color.white);
btn_tiqu.setText(“流量提取”);
btn_rech.setBackgroundResource(R.drawable.icon_rech_right);
btn_rech.setTextColor(color.black);
btn_rech.setText(“流量充值”);
btn_tiqu.setBackgroundResource(R.drawable.icon_rech_left_2);
btn_tiqu.setTextColor(color.white);
btn_tiqu.setText(“流量提取”);
btn_rech.setBackgroundResource(R.drawable.icon_rech_right);
btn_rech.setTextColor(color.black);
btn_rech.setText(“流量充值”);
解决方案
20
一种情况,图片背景是不是和字体颜色一样?
还有一种,图片是不是点9图片啊,点9图片要留出内容区域
还有一种,图片是不是点9图片啊,点9图片要留出内容区域
40
是不是相对布局没布好位置,转换图片的时候被覆盖了