Solution to a black screen on the Unity Android Splah startup interface

The problem to be solved is that after clicking on the App icon to start, the static Splash must be displayed with a black screen, which is very unsightly, please see the picture.Insert picture description here

Friends who have experience in Android development may know that there will be a warm-up time when the APP is opened, which can be disabled, and then the APP will show the effect: click the APP icon and wait for a short period of time before jumping out of the startup interface. OK, then let's just disable preheating!
First we need to find the styles.xml file built into Unity .

The styles.xml directory is found in the Editor\Data\PlaybackEngines\AndroidPlayer\Apk\res\values\styles.xml under the Unity installation directory and
opened with VS. Add a code to disable preheating in the appropriate place:

<?xml version="1.0" encoding="utf-8"?>
<resources> 
<style name="UnityThemeSelector" parent="BaseUnityTheme">
	<item name="android:windowBackground">@android:color/black</item>


  <!--拓展:禁用预热-->
  <item name="android:windowDisablePreview">true</item>



</style>
<style name="BaseUnityTheme" parent="android:Theme.Holo.Light.NoActionBar.Fullscreen">
</style>
<style name="UnityThemeSelector.Translucent" parent="@style/UnityThemeSelector">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
</style>
</resources>

Pack and test again, the effect is as follows:
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44003637/article/details/114987065