RTRootNavigationController icon indicating copy to clipboard operation
RTRootNavigationController copied to clipboard

iOS11 NavVC在TabBarVC 出现偏移

Open zhengbomo opened this issue 7 years ago • 4 comments

TabBarVC -> RTNavigationController -> HomeVC

在homeVC里面push新页面

let vc = NewVC()
vc.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(vc, animated: true)

在push到NewVC的过程中,HomeVC的view会变大(扩大到TabBar底部),使控件整体向下偏移,push后返回又正常

simulator screen shot - iphone x - 2018-02-05 at 12 23 08 simulator screen shot - iphone x - 2018-02-05 at 12 23 10

zhengbomo avatar Feb 05 '18 04:02 zhengbomo

原生的不会是吗,你先设置 self.tabBarController.tabBar.isTranslucent = NO 试试

rickytan avatar Feb 05 '18 11:02 rickytan

换成原生的不会,我是设置edgesForExtendedLayout = init(rawValue: 0) 即ViewController不占TabBar和NavigationBar

zhengbomo avatar Feb 06 '18 06:02 zhengbomo

首先感谢作者 ,目前我的解决方案如下,希望作者有时间有时间fix一下 在 - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated 方法中添加下面的代码即可

CGRect frame = self.tabBarController.tabBar.frame;
frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height;
self.tabBarController.tabBar.frame = frame;

Gentear avatar May 18 '18 04:05 Gentear

直接改 frame 不是个好的解决办法,只能算是临时方案

rickytan avatar May 18 '18 12:05 rickytan