Hello,
I want to implement it in android (ios is possible?)
For Android, I refer this splash screen to add animate in the splash screen. You can add animation in the native android platform by animated-vector
.
Then create a style, add your animation to the style.xml(you can create it by youself) in values folder.
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="AppTheme.Starting" parent="Theme.SplashScreen.IconBackground">
<item name="android:windowSplashScreenAnimatedIcon">@drawable/animated_face</item>
<item name="postSplashScreenTheme">@style/AppTheme</item>
</style>
<style name="AppTheme" parent="Maui.SplashTheme">
<item name="android:windowSplashScreenBackground">@color/colorPrimary</item>
<item name="android:windowLightStatusBar">true</item>
</style>
</resources>
In the end, open your MainActivity.cs
, change Theme = "@style/AppTheme.Starting"
add 3 sceonds delay.
[Activity(Theme = "@style/AppTheme.Starting", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity: MauiAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
AndroidX.Core.SplashScreen.SplashScreen.InstallSplashScreen(this);
base.OnCreate(savedInstanceState);
System.Threading.Thread.Sleep(3000);
}
}
For iOS, iOS do not allow animation in the splash screen.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.