While it is clear why this API exists, it has never been supported on iOS. Setting a tab bar controller's tab bar to hidden is broken in many cases, and in the case of iOS 11 and safe area, it is a show stopper.
this.props.navigator.toggleTabs({
to: 'hidden', // required, 'hidden' = hide tab bar, 'shown' = show tab bar
animated: true // does the toggle have transition animation or does it happen immediately (optional)
});
When a tab bar is hidden in an unsupported way, the safe area does not update. @artald Saw that in an example of his. One App uses this broken API.
In iOS, there is only one sanctioned way that works as expected: Using a controller's hidesBottomBarWhenPushed
and pushing that controller in a navigation controller that is enclosed in the tab bar controller. Here is how it looks:
All other ways break iOS handling of safe area insets and margins.
@DanielZlotin @yogevbd @guyca
This is blocking for Xcode 9 upgrade.
When pushing a screen we can pass tabBarHidden: true
in navigatorStyle
. I think this solve this issue
this.props.navigator.push({
screen: 'example.Types.Push',
navigatorStyle: {
tabBarHidden: true
}
});
@yogevbd Better confirm that before closing the issue
As discussed offline, the issue is not with the push API, but with toggleTabs
.
@LeoNatan One app will stop using that api in v1 and it will be removed from iOS in v2.
馃憤
In v2 we do use hidesBottomBarWhenPushed
Most helpful comment
When pushing a screen we can pass
tabBarHidden: true
innavigatorStyle
. I think this solve this issue