【发布时间】:2015-08-15 11:12:26
【问题描述】:
我知道关于这个的讨论随处可见,我自己也使用过这些文件夹,但在阅读它们之后,我最近对如何在可绘制文件夹中排列图像感到非常困惑 -
看看这个 XML 文件 -
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/wallpaper_chapter_selection"
tools:context="com.greenloop.joindotsandpaint.ChapterSelection">
<ImageView android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/img2"
android:padding="20dp" />
<RelativeLayout
让我们考虑 2 款关于此横向模式的手机 -
Nexus 10 - 2560 像素 * 1600 像素 xhdpi
Nexus 5 - 1920 像素 * 1080 像素 xxhdpi
对于 Nexus 10 - 图片尺寸为 1600 像素(高度) 在 Nexus 5 的情况下 - 图像大小将为 1080 像素
Nexus 10 所需的图像大小将大于 Nexus 5 所需的图像大小,但 Nexus 10 将从 xhdpi 文件夹中获取图像(较小的图像大小),因为它是 xhdpi nexus 5 将从 xxhdpi 文件夹中获取图像。
那么我应该如何解决这个问题。我有很多类似的布局,我面临着类似的问题。
【问题讨论】:
标签: android android-layout android-drawable