Splash Image size

时间秒杀一切 提交于 2019-12-10 17:19:34

问题


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.

Background drawable

<?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

  <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>

回答1:


Splash Image size for different resolution devices for portrait

MDPI = 320x480px 

LDPI = 240x360px

HDPI = 480x720px

XHDPI = 640x960px

XXHDPI = 960x1440px

XXXHDPI = 1280x1920px

From https://romannurik.github.io/AndroidAssetStudio/index.html you can make a 9-patch image for all the resolutions - XHDPI,HDPI,MDPI,LDPI



来源:https://stackoverflow.com/questions/47844826/splash-image-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!