我正在使用 API 16 (Jellybean)、4.0 WVGA (480x800: hdpi)
我正在尝试在背景中设置 480x800 图像
我将图像放在“drawable-hdpi”中,但该图像不适合背景,为什么当我使用 4.0 WVGA(480x800:hdpi)并且与图像大小相同时这不适合背景
drawable 如何适应图像:
这是我的代码:
<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"
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="com.example.newapp.Firstscreen$PlaceholderFragment" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/background" />
</RelativeLayout>
看截图: