简体   繁体   English

ios7导航栏高度突然改变

[英]ios7 suddenly navigation bar height change

hi i want to solution in ios7's problem. 您好,我想解决ios7的问题。

My classes is 我的课是

AlphaViewController : UIViewController,
BetaViewController : UIViewController

when AlphaViewController will appear, Alpha's navigation bar hight is 44.0f . AlphaViewController出现时,Alpha的导航栏高度为44.0f looks like too. 看起来也一样。 and Supported Orientation is Portrait. 并且支持的方向是纵向。

then I use presentmodalViewController for BetaViewController . 然后我用presentmodalViewControllerBetaViewController BetaViewController 's navigation bar will be hide in viewWillAppear . BetaViewController的导航栏将隐藏在viewWillAppear and Supported Orientation is LandScape. 支持的定位是LandScape。

then I use popViewController function. 然后我使用popViewController函数。 so AlphaViewController will be appear again. 因此AlphaViewController将再次出现。 I use self.navigationController.navigationBarHidden = YES; 我使用self.navigationController.navigationBarHidden = YES;

But suddenly Alpha's navigation bar hight is changed. 但是突然阿尔法的导航栏改变了。 It looks like 22.0f . 看起来像22.0f I don't know reason.. 我不知道原因

my english is not good. 我英文不太好。 thanks to read. 感谢阅读。

first of all presentModalViewController: is deprecated since ios6 so you may not use it for presenting an view controller. 首先,自ios6起,不推荐使用presentModalViewController: :,因此您可能无法使用它来呈现视图控制器。

When you present a viewController from an navigationController if you want the navigation bar to be present on AlphaViewController you dont need to hide or un hide. 当您从navigationController呈现viewController时 ,如果希望导航栏出现在AlphaViewController上 ,则无需隐藏或取消隐藏。 Since you are presenting the BetaViewController navigation bar will not appear and when you dismiss it will be visible again in AlphaViewController . 由于您正在演示, 因此不会出现BetaViewController导航栏,并且在您退出时它会在AlphaViewController中再次显示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM