iOS11 push控制器tabbar上移问题

解决方法

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

{

    // 如果有大于控制器

    if (self.childViewControllers.count >= 1) {

 

        viewController.hidesBottomBarWhenPushed = YES;

    }

    [super pushViewController:viewController animated:animated];

    

    // 修正push控制器tabbar上移问题

    if (@available(iOS 11.0, *)){

        // 修改tabBra的frame

        CGRect frame = self.tabBarController.tabBar.frame;

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

        self.tabBarController.tabBar.frame = frame;

    }

}

posted @ 2017-10-10 11:01  HEJJY  阅读(2447)  评论(0编辑  收藏  举报