0

Good Afternoon! I want to use an image as background in my view, the problem is that when I use an image (With a color works perfectly) the background is placed over the elements, so it's not possible to see nothing.

<RelativeLayout 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"
    tools:context=".Greet"
    android:background="@drawable/fondo_panel" >

    <ImageView android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:src="@drawable/logo_panel"/>

</RelativeLayout>

Do you know what's the problem? Thanks a lot!

4

1 回答 1

1

为什么不将图像作为背景添加到 RelativeLayout?所以你不需要 ImageView 并且没有任何重叠。

<RelativeLayout 
    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"
    tools:context=".Greet"
    android:background="@drawable/logo_panel" >

</RelativeLayout>
于 2013-03-08T13:07:27.713 回答