[v2] Android Navigation.setRoot with a stack layout and topBar hidden leaves empty space at the top
First of all, thanks a lot for this library. It's life-saver. Today I've been migrating from v1 to v2 and Im facing some problems so excuse me for all the issues I'm creating today :)
Issue Description
I want to initialize the app with a stack layout and the topBar hidden. So I'm using the following code to do so:
Navigation.events().registerAppLaunchedListener(() => {
Navigation.setDefaultOptions({
topBar: {
visible: false,
},
});
Navigation.setRoot({
stack: {
children: [{
component: {
id: 'xxxx',
name: 'xxxx',
},
}],
},
});
});
This code works great on iOS but on Android, the app launches with the topBar briefly visible, then it animates away but leaves the space at the top empty.
Steps to Reproduce / Code Snippets / Screenshots
Explained above.
Environment
- React Native Navigation version: 2.0.2291
- React Native version: 0.55.4
- Platform(s) (iOS, Android, or both?): Android
- Device info (Simulator/Device? OS version? Debug/Release?): iPhone 7p iOS 11.3 Debug
This also happens to me as well. Also for some reason, about bottom 50px of the screen is not responding to the touch.
Found the solution. You need to add
drawBehind: true to topBar Style
@jinshin1013 Nice, that solved the problem of empty space at the top.
But the topBar still shows up briefly and then animates away. Would be nice to disable that behaviour. I tried doing it from the native side (both on MainActivity and AndroidManifest) with no luck.
@mahyarr I'm closing and will address the flashing TopBar in #3016