【发布时间】:2011-11-15 04:37:52
【问题描述】:
这就是我想要做的:
我有一个 .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);
但似乎什么都没有发生。
我该怎么办?谢谢!
谢谢!
【问题讨论】:
标签: android background drawable transparent