-
在
colors.xml
文件中添加style
。1 2 3 4 5 6 7 8 9 10
<resources> <color name="colorPrimary">#512BD4</color> <color name="colorPrimaryDark">#2B0B98</color> <color name="colorAccent">#2B0B98</color> <style name="SplashTheme" parent="@style/Maui.SplashTheme"> <item name="android:statusBarColor">@android:color/black</item> <item name="android:navigationBarColor">@android:color/black</item> </style> </resources>
-
在
MainActivity.cs
(Platforms/Android)文件中修改主题。1 2 3 4 5
[Activity( //Theme = "@style/Maui.SplashTheme", Theme = "@style/SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)] public class MainActivity : MauiAppCompatActivity