-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Navigation bar overlaps app screen #6423
Comments
Can you give this a title? |
+1 facing the issue with Android 13 devices. |
any updates on this bug? Bug starting from Android API level 33 cuz currently i wrote plugin android-safe-area and in my app code async checkInsets() {
try {
const { top, bottom } = await SafeArea.getInsets();
document.documentElement.style.setProperty('--ion-safe-area-top', top + 'px');
document.documentElement.style.setProperty('--ion-safe-area-bottom', bottom + 'px');
} catch (e) {
console.error(e);
}
} .keyboard-is-open {
height: calc(100% - var(--keyboard-offset, 250px) - var(--ion-safe-area-bottom, 22px));
} Now it freaky working, but we need to be it fixed in core. Thanks in advance. |
I also have this issue on Android 13 but using cordova |
Same here |
seems to be kind of a race condition too. i had an app bootstrapping and while initally mounting the first view, i set the OverlaysWebview to true. this dindt work reliably, when switching to do it in a setTimeou(... , 0) wrapper it started working as expected again. I did not investigate any further yet as this was a rather urgend hotfix. |
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 <3 |
I've encountered the problem and solved the issue;
What happened was
Following snippet is my android setup function and is almost same with the ones in @capacitor/status-bar private void setStatusBarAndNavBar() {
var activity = this.bridge.getActivity();
Window window = activity.getWindow();
View decorView = window.getDecorView();
WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(window, decorView);
// 1. statusBar content color dark (light mode)
windowInsetsControllerCompat.setAppearanceLightStatusBars(true);
// 2. navBar content color dark (light mode)
windowInsetsControllerCompat.setAppearanceLightNavigationBars(true);
// 3. statusBar background color transparent
window.setStatusBarColor(Color.TRANSPARENT);
// 4. navBar background color transparent
window.setNavigationBarColor(Color.TRANSPARENT);
// 5. set render behind statusBar / navBar
// This had no effect on navBar on <android 12 and below + Capacitor 4>, but
// webview successfully rendered behind on navBar on <android 13 + Capacitor 5>
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
int uiOptions = decorView.getSystemUiVisibility();
uiOptions = uiOptions | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
} |
I created a plugin for android fullscreen mode: https://github.com/digaus/community-capacitor-fullscreen Just install and add this somewhere:
|
@digaus |
Yes, that's what the 'insetsChanged' is for. Also takes care of rotation and inset changes. Furthermore I added functions to change the color of the Statusbar and Navigationbar Icons/Buttons |
I am having the exact same issue, for capacitor 4 it was great, i just updated to 5 and have this issue. When i put app to the background and then back in foreground it fixes itself. |
I actually also have that problem with capacitor 4. Whenever the app launches I have this problem. When a request for persmissions appears, or i put the app in the backround and then again in the foreground, the problem is fixed temporarely until i completely close the app. |
Adding a small delay between hiding splash screen and modifying the status bar will resolve this issue. await SplashScreen.hide();
await new Promise(resolve => setTimeout(resolve, 500))
await StatusBar.setStyle({ style: Style.Light });
await StatusBar.setBackgroundColor({ color: '#FFFFFFF' }); Full example here: https://gist.github.com/enesien/5e64d0f29235ece5ecefad025110caf7 |
Have you found any solutions to the problem. |
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"> false true #00000000 </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 |
This is what I did to fix the issue In
Then I removed the call to |
Starting from Android 15, my users get this too: wako-app/wako#121 |
Unfortunately it doesn't. While I didn't see this issue with Capacitor 6, I do have it since I updated to Capacitor 7. |
same here |
I've worked around this in a similar way to what @sam-hu has done - see my comment here for more tips #7804 (comment). |
Bug Report
Capacitor Version
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 addedOther Technical Details
npm --version
output: 9.6.2node --version
output: 18.15.0Additional Context
StatusBar.setOverlaysWebView({ overlay: false })
seems to fix this problemThe text was updated successfully, but these errors were encountered: