Share via

Flyout is overlapping with Status bar

Vaibhav Methuku (ext) 0 Reputation points
2026-02-05T08:05:07.19+00:00

Flyout is overlapping with the status bar on the top, after upgrading that to MAUI 10.

Please find the attachment for reference

User's image

Regards,
Vaibhav Methuku.

Developer technologies | .NET | .NET MAUI
{count} votes

2 answers

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 14,955 Reputation points Microsoft External Staff Moderator
    2026-02-09T08:18:04.4033333+00:00

    Hi @Vaibhav Methuku (ext) ,

    I have created a minimum local project and found a solution.

    image

    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.

    1 person found this answer helpful.

  2. Jack Dang (WICLOUD CORPORATION) 14,955 Reputation points Microsoft External Staff Moderator
    2026-02-16T05:34:23.28+00:00

    Hi @Vaibhav Methuku (ext) ,

    Thanks for your patience!

    On MAUI 10 with Android 15, the flyout overlapping the status bar happens because Android now draws app content under the status bar by default. Simply calling WindowCompat.SetDecorFitsSystemWindows(Window, true) won’t automatically push your flyout down.

    A common approach is to apply padding for the status bar using the system insets. For example, in MainActivity.cs:

    using Android.App;
    using Android.Content.PM;
    using Android.OS;
    using AndroidX.Core.View;
    
    namespace FlyoutTest
    {
        [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);
                if (Window != null)
                {
                    // Enable edge-to-edge display
                    WindowCompat.SetDecorFitsSystemWindows(Window, false);
    
                    // Apply window insets to prevent content from overlapping system bars
                    ViewCompat.SetOnApplyWindowInsetsListener(Window.DecorView, new WindowInsetsListener());
                }
            }
    
            private class WindowInsetsListener : Java.Lang.Object, IOnApplyWindowInsetsListener
            {
                public WindowInsetsCompat? OnApplyWindowInsets(Android.Views.View? v, WindowInsetsCompat? insets)
                {
                    if (v is not null && insets is not null)
                    {
                        var systemBars = insets.GetInsets(WindowInsetsCompat.Type.SystemBars());
                        if (systemBars is not null)
                        {
                            v.SetPadding(systemBars.Left, systemBars.Top, systemBars.Right, systemBars.Bottom);
                        }
                    }
                    return insets;
                }
            }
        }
    }
    

    Please note that this code is provided as a reference. Depending on your app’s layout, custom flyout, or device, you might need to adjust it to get the exact behavior you want.

    User's image

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.