Android:透明图片

时间:2016-03-17 16:29:23

标签: android image text transparent

我需要将文字放在透明图像上,但我的文字也是透明的。

更新:我有一个活动背景,这是一张图片,而不是我的LinearLayout背景为透明图片,在那个布局中,我需要一个TextView,文本没有透明度。

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/img_background"
android:fitsSystemWindows="true"
tools:context="team.com.ContactUsActivity">
>
<LinearLayout
    android:id="@+id/linearLayoutContactUsData"
    android:layout_width="match_parent"
    android:layout_height="200dip"
    android:background="@drawable/img_contact_us"
    android:alpha="0.4"
    >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:textColor="#FFFFFF"
        android:textSize="18dip"
        android:text="Phone: 111-111-111"
        />
</LinearLayout>

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

只需删除android:alpha 如果你不这样做,TextView将继承容器属性,使其透明,而不是完全可见。

TextView背景默认是透明的。