导航栏重置其框架
我有一个以编程方式创建的 TabBar。在此选项卡栏的视图控制器中,我尝试使用 - 减小导航栏的大小 “self.navigationController.navigationBar.frame = CGRectMake(0, 20, 320, 30);”
视图控制器第一次加载时,导航栏显示为我指定的尺寸,但之后它会自动重置其尺寸。
可以从 http://dl.dropbox.com/u 下载存在此问题的示例/2647092/iPhone_tabbar_example.zip 要在此示例中复制此问题,请按照以下步骤操作 -
- 在模拟器中打开并运行项目,
- 单击 Tab1,然后单击 Tab2,再次单击 Tab1,Tab1 的导航栏将调整为其默认尺寸
我做错了什么吗在这种情况下还是有其他方法可以做到这一点?
请告诉我。
谢谢, 约格什
I have a TabBar which has been created programmatically. In the view controllers of this tab bar I am trying to reduce the size of navigation bar using -
"self.navigationController.navigationBar.frame = CGRectMake(0, 20, 320, 30);"
For the first time the view controller loads the navigation bar is displayed with the dimensions specified by me, but after that it automatically resets its dimensions.
An example having this issue can be downloaded from http://dl.dropbox.com/u/2647092/iPhone_tabbar_example.zip
To replicate this issue in this example follow these steps -
- open and run the project
- in the simulator click on Tab1 then click on Tab2 again click on Tab1 the Navigation bar of Tab1 would be resized to its default dimension
Is there any thing wrong I am doing in this case or is there an alternative method to do this?
Please let me know.
Thanks,
Yogesh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了这个问题的解决方案...而不是在 viewWillAppear 中调整导航栏的大小,而是在 viewDidAppear 中调整它的大小
Got the solution to this problem...instead of resizing the navigation bar in viewWillAppear resize it in the viewDidAppear