美文网首页
解决iPhoneX上push的时候tabBar上移的问题

解决iPhoneX上push的时候tabBar上移的问题

作者: 南宫零三 | 来源:发表于2017-11-20 11:35 被阅读0次

因为我的项目用的是storyboard布局的,新建一个类BaseNavigationController继承UINavigationController,然后重写- (void)pushViewController:(UIViewController*)viewController animated:(BOOL)animated这个方法;

代码:

- (void)pushViewController:(UIViewController*)viewController animated:(BOOL)animated {

[superpushViewController:viewControlleranimated:animated];

//改tabBar的frame 在iPhoneX上push上移的问题

CGRectframe =self.tabBarController.tabBar.frame;

frame.origin.y= [UIScreenmainScreen].bounds.size.height- frame.size.height;

self.tabBarController.tabBar.frame= frame;

}

然后在storyboard里面,控制器的navigationController继承与这个类BaseNavigationController;

相关文章

网友评论

      本文标题:解决iPhoneX上push的时候tabBar上移的问题

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