2016-03-01 49 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