Visual Studio升级后MAUI启动屏仅显背景无图片求助
MAUI Android启动屏仅显示背景不加载图标问题解决方案
检查Android启动屏样式配置
打开Platforms/Android/Resources/values/styles.xml,确认启动屏主题正确引用了生成的drawable资源:<style name="Maui.SplashTheme" parent="Maui.SplashBaseTheme"> <item name="android:windowBackground">@drawable/splash_screen</item> </style>若
Platforms/Android/Resources/drawable下没有splash_screen.xml及对应png资源,执行清理+重建项目(Build菜单下的Clean Solution再Rebuild Solution),触发VS重新生成资源。手动处理SVG资源
预览版VS可能存在SVG转Android资源的bug,手动导出适配资源:- 将根目录
Resources/Splash/splash.svg导出为mdpi、hdpi、xhdpi、xxhdpi、xxxhdpi五种分辨率的PNG图 - 在
Platforms/Android/Resources下对应dpi的drawable目录(无则新建)放入对应PNG - 修改
styles.xml里的android:windowBackground为@drawable/splash(不带文件后缀)
- 将根目录
切换到VS稳定版
暂时降级到Visual Studio 2022 17.4.x稳定版本,该版本对MAUI Android启动屏资源生成的兼容性更好,能正常处理splash.svg转换。验证Manifest配置
打开Platforms/Android/AndroidManifest.xml,确认Application标签的theme属性设置为启动屏主题:<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:theme="@style/Maui.SplashTheme">
内容的提问来源于stack exchange,提问作者nimitz
相关产品推荐
相关产品推荐

