我在ImageView中有Image,因为我将它用作动画背景。如何显示图片以使其高度填充整个父级和宽度显示屏幕宽?
我尝试使用此代码进行此操作:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/background"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/background"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"/>
</RelativeLayout>
但它不起作用。它只是在屏幕内部显示整个画面,将其宽度调整为屏幕的宽度。我在哪里误会?
答案 0 :(得分:1)