Android 如何制作splash徽标fitCenter?
我正在尝试为我的应用程序制作一个启动屏幕。这是我的splash drawable:Android 如何制作splash徽标fitCenter?,android,splash-screen,Android,Splash Screen,我正在尝试为我的应用程序制作一个启动屏幕。这是我的splash drawable: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/col
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@color/colorRed"/>
<item>
<bitmap
android:gravity="center|fill"
android:src="@drawable/logoimage"/>
</item>
</layer-list>
但标识图像总是被裁剪和干扰。看起来不太好。我想让它像ImageView scaletype的fitCenter选项一样
我该怎么做呢?这里最重要的是你的形象
gravity
不需要fill
属性<代码>中心属性将完成此任务您可以在drawable中添加更多“logoimage”
并去除重力“填充”,只需“居中”
因此我必须导入不同分辨率大小的图像。我该怎么做呢。我不知道该怎么办。我刚刚将我的图像复制到可绘制文件夹。你能指导我吗?我已经更新了答案。您可以使用图像编辑器调整图像大小。
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@color/colorRed"/>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/logoimage"/>
</item>
</layer-list>