这是可绘制文件:
<?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
。
顶部偏移量(以像素为单位。)>
android:top