2015-11-03 135 views

回答

0

有没有办法做到这一点 - 按钮状态的所有“外观”都是可绘制的。你可以替换他们创建自己的图形或使用Holo generator(deprected,使用AppCompat LIB prefering)

HERE你有着色按钮(“阴影”会留一个Selector例子,还的方法,但会在你的色彩搭配应用风格)

0
ImageView.setColorFilter(Color.argb(255, 93, 93, 93)); 

这是灰色,你可以根据你的图像背景颜色设置。

0

尝试设置背景绘制你的按钮:

btn.setBackgroundResource(R.drawable.yellow_button); 

yellow_button.xml:

<!-- pressed --> 
<item android:drawable="@drawable/button_1_selected" android:state_pressed="true"/> 
<!-- focused --> 
<item android:drawable="@drawable/button_1_normal" android:state_focused="true"/> 
<!-- default --> 
<item android:drawable="@drawable/button_1_normal"/>