这是可绘制的文件:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
<item>
<color android:color="#ffffffff"/>
</item>
<item>
<bitmap android:gravity="top|center_horizontal"
android:src="@drawable/splash_screen"/>
</item>
</layer-list>
我希望位图具有20px的margin-top,但我没有找到如何将margin-top设置为bitmaps元素
您可以尝试使用android:top
。
顶部偏移量(以像素为单位)。
<item
android:top="20dp">
<bitmap android:gravity="top|center_horizontal"
android:src="@drawable/splash_screen"/>
</item>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句