我有以下内容:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/splash_background"/>
</shape>
</item>
<item>
<!-- this icon is a placeholder for real icon, still waiting on -->
<bitmap
android:gravity="center"
android:src="@drawable/splash_png"/>
</item>
</layer-list>
问题是我们支持调整应用程序的大小,因此 png(在 xhdpi 上为 780 px 宽)在具有高 dpi 的较小设备上被剪辑。我想添加一个条件,以防它被剪裁;它反而缩小了。我如何实现这一目标?我需要像maxWidth这样的东西。