capacitor: bug: Navigation bar overlaps app screen
Bug Report
Capacitor Version
Latest Dependencies:
@capacitor/cli: 4.6.1
@capacitor/core: 4.5.0
@capacitor/android: 4.6.2
@capacitor/ios: 4.4.0
Installed Dependencies:
@capacitor/cli: 4.7.0
@capacitor/core: 4.7.0
@capacitor/android: 4.7.0
@capacitor/ios: 4.7.0
[success] Android looking great! 👌
[error] Xcode is not installed
Platform(s)
Android 13
Current Behavior
Navigation bar overlaps app screen

Expected Behavior
Not overlapping it

Code Reproduction
The error only happen in production, here for a working example
Code Reproduction : https://github.com/rbalet/ionic-navigation-bar-overlaps
see the add - Code reproduction branch to see which code have been added
Other Technical Details
npm --version output: 9.6.2
node --version output: 18.15.0
Additional Context
- It does not happen all the time
- I didn’t had this error before updating to Android 13, so seems to be related to this version
StatusBar.setOverlaysWebView({ overlay: false })seems to fix this problem- The following also seems to help (Will update if I get any news)
private _setStatusBar() {
if (Capacitor.getPlatform() === 'android') {
setTimeout(() => {
StatusBar.setOverlaysWebView({ overlay: true })
StatusBar.setBackgroundColor({ color: '#00000000' })
}, 100)
}
}
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 9
- Comments: 17 (3 by maintainers)
+1 facing the issue with Android 13 devices.
I also have this issue on Android 13 but using cordova
Please, do just upvote the main issue instead of writing “non helpful text” so that the ionic team can better see if this have to be prioritised
Thx a lot ❤️
And u need write it in style.xml, it is mandatory here to assign a color to android:statusBarColor:
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <item name="android:statusBarColor">#00000000</item> </style>These steps work for me and solved this bug, now the status bar is transparent and works as it should.
It is photo: https://github.com/ionic-team/capacitor/assets/64776696/8eb3a7e3-19b5-426d-b275-270b7d247544
I created a plugin for android fullscreen mode: https://github.com/digaus/community-capacitor-fullscreen
Just install and add this somewhere:
I’ve encountered the problem and solved the issue; My expected setup is
What happened was
Following snippet is my android setup function and is almost same with the ones in @capacitor/status-bar