CommunityToolkit / CommunityToolkit/Maui

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

Open
#2,351 7 comments 3 reactions 0 assignees View on GitHub
area/behaviors bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

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

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

On an Android device, if I add
```



```
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](https://github.com/user-attachments/assets/b500d22f-a451-45e0-9a2b-b4d1c5e31919)

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](https://github.com/user-attachments/assets/094318da-3a72-4015-8088-b804d5cc30f2)

### 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

```markdown
- .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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.