2015-11-03 137 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"/>