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;

    }

}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM