iOS
Android
Constants returns a promise but is documented as synchronous function. Also the returned value is wrong on my phone LG G4 returns 96 224.5 which apparently is way too high values for status and topbar.
Navigation.constants().then(({ statusBarHeight, topBarHeight }) => {
console.log(statusBarHeight, topBarHeight)
})
I'm getting '0' for my topBarHeight and bottomTabsHeight. statusBarHeight appears to be reported correctly ('44').
drawUnder by any chance?
@thame
The code of below works fine.
Navigation.events().registerAppLaunchedListener(async () => {
await Navigation.setRoot({
root: {
stack: {
children: [
{
component: {
name: "screen"
}
}
],
});
const c = await Navigation.constants();
console.log(c.topBarHeight);
});
https://github.com/wix/react-native-navigation/blob/v2/lib/ios/Constants.m#L10
Looking at the current implementation, it returns the height of the navigationBar of navigationController of rootViewController. So, in the current implementation, it seems that the height can be taken only after displaying the screen with stack layout.
I am getting wrong value
Constants聽{statusBarHeight: 63, topBarHeight: 147.5, backButtonId: "RNN.back", bottomTabsHeight: undefined}
Hi, I am also getting a value of 0 for topBarHeight.
My top bar config:
topBar: {
animate: true,
hideOnScroll: false,
buttonColor: "black",
drawBehind: true,
backButton: {
color: "black"
}
In researching why the registerNavigationButtonPressedListener
doesn't report events on iOS, I'm seeing that backButtonId
is undefined on iOS. Is this intentional? I'm starting to think that is the reason why it's not working. Can we set this anywhere?
Same issue, very odd documentation, sjhowing that we can to use something but it requires more code, but even that it doesnt work with ios?
Most helpful comment
Hi, I am also getting a value of 0 for topBarHeight.
My top bar config:
topBar: { animate: true, hideOnScroll: false, buttonColor: "black", drawBehind: true, backButton: { color: "black" }