我想调整 a 中的位图大小layer-list
,添加为item
.
这是我尝试过的,
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<solid android:color="@android:color/white" />
<size
android:width="46dp"
android:height="46dp" />
</shape>
</item>
<item
android:width="11dp"
android:height="24dp"
android:gravity="center">
<bitmap android:src="@drawable/facebook_f" />
</item>
</layer-list>
使用 Android Studio 2.0 Preview 5,显示的预览是完美的,但实际图像是一个错误。
由 AS 预览,
实物图,
手动或在 xml 中更改图像资源大小不会改变任何内容。
注意:“f”形图像尺寸为 53 * 128。
编辑:AS 使用 API 版本 23 来呈现布局。当我将它更改为 21(我也在测试它)时,它看起来很模糊。我在 Android M 设备上进行了同样的检查,图像非常完美。所以现在,这个 xml 的行为是特定于 API 的。