Android Studio 2.0 预览版3b
你好,
我创建了以下布局,想用作我的应用程序的背景。我正在使用
这就是我想要的,以及它在 AVD 和 Nexus 5 上的显示方式。如您所见,没有问题。
我已将
非常感谢任何建议。
你好,
我创建了以下布局,想用作我的应用程序的背景。我正在使用
layer-list
并希望在两个位置显示一碗豌豆。预览看起来一切正常,但当我在 genymotion 或一些廉价的中国设备上运行时,图像会拉伸到整个屏幕。然而,在 Android AVD 上,一切看起来都很好,在我的 Nexus 5(真实设备)上也一切正常。这就是我想要的,以及它在 AVD 和 Nexus 5 上的显示方式。如您所见,没有问题。
![](https://istack.dev59.com/OvAjb.webp)
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:centerX="0.5"
android:centerY="0.3"
android:endColor="#08e25b"
android:gradientRadius="300dp"
android:startColor="#b7e9c9"
android:type="radial" />
</shape>
</item>
<item
android:width="48dp"
android:height="48dp"
android:left="350dp"
android:top="400dp">
<bitmap android:src="@drawable/peas" />
</item>
<item
android:width="68dp"
android:height="68dp"
android:drawable="@drawable/peas"
android:left="-20dp"
android:top="480dp" />
</layer-list>
我已将
peas.png
文件放置在drawable-nodpi
中,并在layer-list
中添加了宽度和高度。
当我在Genymotion和一些廉价的智能设备上运行时,我得到以下结果:
我很困惑应该相信什么,我也尝试使用位图来看是否有所不同。Just quick summary. Nexus 5 real device and AVD devices works ok Genymotion and cheap smart devices doesn't display correctly
非常感谢任何建议。