Android 背景拟合线性布局

Android 背景拟合线性布局,android,background,Android,Background,我希望背景图片不要变形,但每次我尝试时,ImageView会出现在其他UI元素前面 我已经尝试使用图像视图android:src和scaleType=center, 当我尝试使用其他布局时,我无法使图片适合。尝试设置scaleType=matrix,如果这也没有帮助,则存在内部填充问题,我将发布customImageview。 干杯 试试这个: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="

我希望背景图片不要变形,但每次我尝试时,
ImageView
会出现在其他UI元素前面

我已经尝试使用图像视图android:src和
scaleType=center

当我尝试使用其他布局时,我无法使图片适合。

尝试设置
scaleType=matrix
,如果这也没有帮助,则存在内部填充问题,我将发布customImageview。 干杯

试试这个:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:contentDescription="@string/xxxx"
        android:src="@drawable/xxxx" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/xxxx"
        android:orientation="vertical" >

        <RelativeLayout
            android:id="@+id/today"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:text="xxx"
                android:textSize="xxsp" />
        </RelativeLayout>

    </LinearLayout>


你能发布一些你拥有的和你想要实现的图片吗?将图像设置为父视图组的背景,并在其上设置
alpha
。。