这就是我要做的:
我有一个。png图像作为背景为我的TextView;文本的颜色是白色的。为了使文本更容易阅读,我想在我的。png图像的顶部添加一个半透明的黑色图层。
这是我到目前为止所做的:
<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"/>
我试着添加android:background="@color/blackOpaque">但是Eclipse抱怨我已经有了一个背景图像。所以我试着改变我的图像文件的透明度,像这样:
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" />