美文网首页
React-native隐藏tabbar

React-native隐藏tabbar

作者: 街角仰望 | 来源:发表于2016-11-24 17:05 被阅读222次

项目中使用NavigatorIOS隐藏tabBar的方法

找到RCTNavigator.m

-(void)navigationController:(UINavigationController)navigationController willShowViewController:(__unused 
UIViewController *)viewController animated:(__unused BOOL)animated

函数最开始添加

if (navigationController.viewControllers.count > 1) { 
  navigationController.tabBarController.tabBar.hidden = YES; 
} 
else { 
 navigationController.tabBarController.tabBar.hidden = NO; 
}

就可以了

相关文章

网友评论

      本文标题:React-native隐藏tabbar

      本文链接:https://www.haomeiwen.com/subject/zuolyttx.html