CommunityToolkit / Maui

The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier
https://learn.microsoft.com/dotnet/communitytoolkit/maui
MIT License
2.28k stars 404 forks source link

[BUG] StatusBarBehavior is causing Android layouts to go behind status bar and navigation bar buttons on launch #2351

Open ckrutsinger opened 3 days ago

ckrutsinger commented 3 days ago

Is there an existing issue for this?

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

On an Android device, if I add

    <Shell.Behaviors>
        <xct:StatusBarBehavior StatusBarStyle="LightContent"/>
    </Shell.Behaviors>

then the first page displayed by the app will have the TitleView behind the phone's status bar and the bottom elements behind the Android navigation bar. In the repro app, the TabBar tabs are behind the Android navigation bar making them inaccessible for clicking.

Image

Not able to reproduce on iOS. No other platforms tested.

Expected Behavior

Expected behavior is to position the TitleView below the status bar and the bottom of the ContentPage should be above the Android navigation bar.

Image

Steps To Reproduce

  1. Run the repro app.
  2. You will immediately see that the layouts are not sized correctly.

Link to public reproduction project repository

https://github.com/ckrutsinger/StatusBarBehaviorBug

Environment

- .NET MAUI CommunityToolkit: 9.1.1
- OS: Android 11+
- .NET MAUI: 8.0.100

Anything else?

Appears that the StatusBarBehavior is causing the screens to receive the wrong sizing frame during layout.