0
我有按鈕,並設置背景資源給它:按鈕背景Alpha重複
button1.setBackgroundResource(R.layout.color00);
color00:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/img00" />
<item
android:state_pressed="false"
android:drawable="@drawable/img00" />
</selector>
然後我設置阿爾法這個按鈕
button1.getBackground().setAlpha(50);
,然後我有問題。如果我設置這樣的背景資源BUTTON2:
button2.setBackgroundResource(R.layout.color00);
所以BUTTON1的Alpha設置爲BUTTON2與該資源阿爾法。如何解決它?
button2.getBackground()。setAlpha(50); – 2012-02-28 15:25:13
我想要有100%alpha的button2 – Leo 2012-02-28 20:23:23