2016-03-01 48 views

回答

2

我認爲這是你正在努力實現(用什麼背景色工作,而不是與背景圖像)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:gravity="center" 
android:background="#f00" 
android:orientation="vertical"> 

<Button 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="#88000000" 
    android:gravity="center" 
    android:text="TEXT TO TRANSPARENT" 
    android:textColor="#f00" /> 

</LinearLayout> 

創建一個新的佈局文件,粘貼上面的代碼,然後單擊佈局「預覽」按鈕,以檢查它的樣子。

OR

檢查此鏈接 Button with background color and transparent text

+0

感謝您的鏈接。真的很感激它。 – Bugdroid

0

的原因是,你是不是設置按鈕的背景顏色,因爲它應該是...嘗試#07000000的按鈕,背景和

+0

對不起,但是當字體應該是#00000000時,字體也會採用#07000000的顏色。感謝您的幫助 – Bugdroid