A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
I have created a minimum local project and found a solution.
Below is my code change:
AppShell.xaml:
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="Flyout.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Flyout"
xmlns:views="clr-namespace:Flyout.Views"
Title="Flyout">
<FlyoutItem Title="Student" Route="student">
<ShellContent
Title="Student"
ContentTemplate="{DataTemplate views:StudentPage}" />
</FlyoutItem>
<FlyoutItem Title="Teacher" Route="teacher">
<ShellContent
Title="Teacher"
ContentTemplate="{DataTemplate views:TeacherPage}" />
</FlyoutItem>
</Shell>
Platforms/Android/MainActivity.cs:
using Android.App;
using Android.Content.PM;
using Android.OS;
using AndroidX.Core.View;
namespace Flyout
{
[Activity(
Theme = "@style/Maui.SplashTheme",
MainLauncher = true,
LaunchMode = LaunchMode.SingleTop,
ConfigurationChanges =
ConfigChanges.ScreenSize |
ConfigChanges.Orientation |
ConfigChanges.UiMode |
ConfigChanges.ScreenLayout |
ConfigChanges.SmallestScreenSize |
ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Ensure app content is laid out below system bars (status/nav)
WindowCompat.SetDecorFitsSystemWindows(Window!, true);
}
}
}
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.