我在 C# 上使用 WPF,我添加了一个*.png图像并将其配置为启动画面。 这个 png 文件的分辨率为 1100x800 像素,问题是我的应用程序将支持多种屏幕分辨率。 所以这个尺寸的启动画面对于小屏幕(如 1366x768 屏幕)来说会很大。 如果我缩小启动画面的大小,这对于大屏幕(如 ...
提示:本站收集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()
):在我的自定义启动屏幕显示在我的 webview 上之前,我的 mipmap 徽标的前景与灰色背景一起显示(启动屏幕从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
: AndroidManifest
:
<application
....
android:icon="@mipmap/ic_favicon_1144_round"
....
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 :)即使您无法回答整个问题,对此的任何帮助都会非常感激:谢谢:)
I suggest you to use the latest splash screen if you are using android 12 and above如果您使用的是android 12及以上,我建议您使用最新的启动画面
you should ad this code in your theme.xml
你应该在你的主题中添加这个代码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
当然,您应该将此代码添加到activity section
的manifest
文件中
android:theme="@style/Theme.Starting"
and this code in you main activity, after onCreate and before setContent view这段代码在你的主要活动中,在 onCreate 之后和 setContent 视图之前
val splashScreen = installSplashScreen()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.