简体   繁体   中英

How to change the screen before the splash screen?

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文简体   中文繁体   中英对照 版本,有任何建议请联系yoyou2525@163.com。

The foreground of my mipmap logo shows along with a grey background before my custom made splash screen shows over my webview (the splash screen gets shown from onCreate() ):

在此处输入图像描述

I want to change the background color to white, and also, if possible, change the image to instead of the foreground of the app icon, show both the background and foreground so it shows as a complete logo. Is this possible? And if so, how?

Here's some of my code:

AndroidManifest :

<application
    ....
    android:icon="@mipmap/ic_favicon_1144_round"
    ....

ic_favicon_1144_round :

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
     <background android:drawable="@color/ic_favicon_1144_background"/>
     <foreground android:drawable="@drawable/ic_logo_48_foreground"/>
 </adaptive-icon>

By the way, I haven't done any code to show the foreground or the grey background specifically. If you'd like to see any more code just drop a comment and I'll edit in my question. Any help on this would be really appriecated, even if you can't awnser the entire question: Thank you :)

1 anwsers

I suggest you to use the latest splash screen if you are using android 12 and above

you should ad this code in your theme.xml

</style>

<style name="Theme.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/purple_700</item>
<item 
 name="windowSplashScreenAnimatedIcon">@drawable/ic_round_local_movies_24</item>
<item name="windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/Theme.MoviesApp</item>
</style>

you can adjust the icon and background in here

and of course you should add this code to your manifest file in the activity section

android:theme="@style/Theme.Starting"

and this code in you main activity, after onCreate and before setContent view

val splashScreen = installSplashScreen()
3 Adding Screen Before Splash

Can i add some images(3) on scroll view to flip them as page controller and include them with the splash, so that they only appear when someone instal ...

暂无
暂无

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM