本文来自投稿,不代表长河网立场,转载请注明出处: http://www.changhe99.com/a/AEd4VoKron.html
如何解决iPhone X Push 过程中 TabBar位置上移,iPhoeXPuh过程中TaBar如何位置上移
iPhoneXPush过程中TabBar如何位置上移工具/原料苹果手机方法/步骤1发现问题来个慢动作:2上图可发现,点击跳转的时候,TabBar的确迅速上移了一段距离,没搞懂为啥,也许苹果别有用心,但我在心里还是骂了一下库克等人。解决问题在UINavigationController的基类重写pushViewController代理方法,在Push的时候修正一下TabBar的frame-(void)pushViewController:(UIViewController*)viewControlleranimated:(BOOL)animated{ if(self.viewControllers.count>0){ if([viewControllerconformsToProtocol:@protocol(XYTransitionProtocol)]&&[selfisNeedTransition:viewController]){ viewController.hidesBottomBarWhenPushed=NO; }else{ viewController.hidesBottomBarWhenPushed=YES; } } [superpushViewController:viewControlleranimated:animated]; //修改tabBra的frame CGRectframe=self.tabBarController.tabBar.frame; frame.origin.y=[UIScreenmainScreen].bounds.size.height-frame.size.height; self.tabBarController.tabBar.frame=frame;}3修正完的效果:END
赞
(0)