我的mipmap徽标的前景与灰色背景一起显示,然后我的自定义启动屏幕显示在我的webview上(启动屏幕显示在onCreate()上):

我想改变背景颜色为白色,如果可能的话,改变图像为取代前景的应用图标,同时显示背景和前景,所以它显示为一个完整的标志。这个是可能的吗?如果是,怎么做?
以下是我的一些代码:
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>顺便说一下,我没有做任何代码来具体显示前景或灰色背景。如果您想看到更多的代码,只需删除一个评论,我将在我的问题编辑。在这方面的任何帮助都会得到认可,即使你不能回答整个问题!谢谢您:)
发布于 2022-08-06 16:52:58
如果您使用的是android 12及以上版本,我建议您使用最新的启动屏幕。
您应该在您的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>您可以在这里调整图标和背景。
当然,您应该将此代码添加到manifest文件中的activity section中。
android:theme="@style/Theme.Starting"这段代码在您的主要活动之后,在onCreate和setContent视图之前
val splashScreen = installSplashScreen()https://stackoverflow.com/questions/73261387
复制相似问题