初始图像尺寸 [英] Splash Image size
本文介绍了初始图像尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用主题而不是布局来显示初始屏幕,但是由于
I am using theme instead of layout to show splash screen,but I am confused what resolution images to set for different screen densities,because <item>
tag's width and height attributes available API>22.
背景可绘制
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorAccent" />
<item >
<bitmap
android:gravity="center"
android:src="@drawable/splash_logo" />
</item>
</layer-list>
样式
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_background</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorPrimary">@color/colorPrimary</item>
</style>
推荐答案
初始图像尺寸(针对人像
MDPI = 320x480px
LDPI = 240x360px
HDPI = 480x720px
XHDPI = 640x960px
XXHDPI = 960x1440px
XXXHDPI = 1280x1920px
来自 https://romannurik.github.io/AndroidAssetStudio/index .html ,您可以针对所有分辨率-XHDPI,HDPI,MDPI,LDPI
From https://romannurik.github.io/AndroidAssetStudio/index.html you can make a 9-patch image for all the resolutions - XHDPI,HDPI,MDPI,LDPI
这篇关于初始图像尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文