问:我遇到了导航控制器问题

时间:2016-06-21 11:36:01

标签: ios animation push uitabbar

有人遇到过这个问题吗? 当我从UIViewController推送到基于故事板的viewController并隐藏BottomBar时,故事板基础viewController首先出现在白色底部,故事板基础{ {1}}底部控件立刻向下移动,覆盖了白色空白区域。有些朋友知道它出现的原因吗?以及如何解决这个问题?

代码在这里:

viewController

BTW:如果我设置 InformationCollectionViewController *info = [self.sb instantiateViewControllerWithIdentifier:@"InformationCollectionViewController"]; info.hidesBottomBarWhenPushed = YES; [self.navigationController pushViewController:info animated:YES]; 不会显示这个问题。

2 个答案:

答案 0 :(得分:0)

1.当您设置动画NO时,它将显示最后的视图状态 2.如果将一些视图布局到底部布局指南,您将在动画开头看到底部栏。如果您布局到顶级视图,则不会出现此问题。

答案 1 :(得分:0)

我通过参考:This link

解决了这个问题

与参考文献有一些不同。 在info控制器:view我要约束,只应更改底部约束。在Xcode 7之前,解决方案可能是:constrain view.bottom to superview.bottom not bottomLayoutGuide in storyboard 但是在Xcode7之后,我的解决方案已经完成了。

我的解决方案是:

1.按Ctrl并将我想要约束的view拖到info控制器的View左侧列中。然后显示{{1} }}

2.然后我按constraints picker,以显示其他ALT,包含constraints,现在您应该选择它。

3.然后您可以编辑Bottom Space to Container Margin,确保

第一项:Bottom Margin Alignment Constraint
关系:Superview.Bottom Margin 第二项:Equal

顺便说一句:感谢你@Lumialxk,感谢你对这个问题的启示。

相关问题