在Android TextView的背景图像上添加一个半透明的黑色层
这就是我想做的: 我有一个.png图像作为我的文本视图的背景;文本的颜色为白色。为了使文本更容易阅读,我想在我的.png图像上添加一个表面不透明的黑色层 这就是我到目前为止所做的:在Android TextView的背景图像上添加一个半透明的黑色层,android,background,drawable,transparent,Android,Background,Drawable,Transparent,这就是我想做的: 我有一个.png图像作为我的文本视图的背景;文本的颜色为白色。为了使文本更容易阅读,我想在我的.png图像上添加一个表面不透明的黑色层 这就是我到目前为止所做的: <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/aboutContent" android:layout_width="fill_parent" and
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/aboutContent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:text="@string/aboutEN"
android:textColor="#FFFFFF"
android:background="@drawable/myimage"/>
但似乎什么也没发生
我该怎么办?谢谢
谢谢
Drawable myimage = getResources().getDrawable(R.drawable.myimage);
myimage.setAlpha(50);
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:background="@drawable/myimage" />
<TextView android:id="@+id/aboutContent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/aboutEN"
android:background="#AA000000"
android:textColor="#ffffff" />