相关疑难解决方法(0)

如何设置背景图片Android xml文件的透明度

我已经使用以下代码行将图像作为我的Android应用程序的背景:

 android:background="@drawable/background"
Run Code Online (Sandbox Code Playgroud)

我现在想让它透明40%但是在xml文件中这怎么可能?我的exm文件如下所示:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:alpha="0.6"
android:orientation="vertical"
android:padding="30dp"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".SecondActivity" >

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingBottom="5dp"
    android:text="Welcome"
    android:textColor="#292421"
    android:textSize="17sp"
    android:textStyle="bold" />

<TextView
    android:id="@+id/TextView01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:text="This Android application is used to track and record the movements of a person throughout the university of ulster, Magee Campus. The tracking phase of the application can only be initiated whilst within the campus and off campus tracking is unavailable at this moment in time."
    android:textColor="#292421" …
Run Code Online (Sandbox Code Playgroud)

xml android android-layout

28
推荐指数
4
解决办法
6万
查看次数

标签 统计

android ×1

android-layout ×1

xml ×1