I've recently upgraded from .NET 9 to .NET 10. My MAUI app runs on both Windows and Android and uses AppFlyout rather than the conventional AppShell. When running the app on Android 15 the flyout menu now overwrites the status bar at the top of the screen but on .NET 9 this didn't happen. Is there a method of calculating the status bar height in Android 15 rather than hard-coding a value for an Android-only margin at the top of the menu?
1 Answer
you just have to disable edge-to-edge in MainActivity
using Android.App;
using Android.Content.PM;
using Android.OS;
using AndroidX.Core.View;
namespace clic2market.mobile;
[Activity(Theme = "@style/Maui.SplashTheme", 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)
{
base.OnCreate(savedInstanceState);
// Disable edge-to-edge: let system fit windows (content won't draw under system bars)
WindowCompat.SetDecorFitsSystemWindows(Window, true);
}
}
New contributor
Jose Benitez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.