I added a splash screen to my game, but it isn’t responsive even though I added 4 different sizes.
I tried changing style attribute and adding different sizes of the same file into mipmap files.
logo files sizes
mdpi -> 737 x 381
hdpi -> 1104 x 570
xhdpi -> 1472 x 760
xxhdpi -> 2209 x 1141
I used photoshop’s asset export so it made the sizes automatically. I might have entered dpi information. I’m not sure.
AndroidManifest.xml file
<activity android:configChanges="orientation|keyboardHidden|screenSize" android:label="@string/app_name" android:launchMode="singleTask" android:name="org.cocos2dx.javascript.AppActivity" android:screenOrientation="portrait" android:taskAffinity="" android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
styles.xml file
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="AppTheme" parent="@android:style/Theme.NoTitleBar">
<item name="android:windowBackground">@drawable/layout</item>
</style>
</resources>
layout.xml file
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/black" />
</shape>
</item>
<item android:gravity="center">
<bitmap android:src="@mipmap/splalogo" />
</item>
</layer-list>
I got the same result on different devices though they are pretty similar in screen and pixel sizes. like all of them were 1080p.