添加导航器控制器 +视图到窗口不旋转到横向
我有一个基于选项卡栏的应用程序。选项卡控制器位于窗口顶部。我尝试在窗口顶部添加导航控制器+视图。效果很好。但是当我尝试按下实际上在横向视图中启动此操作的按钮时,它仍然显示在纵向视图中。我在导航器的 uiview 中的 shouldAutoRotate 中设置了这些参数。
我应该向窗口添加任何内容以使其旋转吗?或者可能出了什么问题?
I have a tabbar based application. The tabbarcontroller is on the top of the window. I tried to add a navigation controller+view on the top of the window. It works fine. but when i try to press the button which actually intiates this in landscape view it is still getting displayed in the potrait view. I set those parameters in shouldAutoRotate in the uiview of the navigator.
Should i add anything to window to make it rotate ? or what could be wrong ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我犯了一个非常简单的错误。就像我应该设置视图的边界和框架以及导航栏视图的边界和框架。
1. 设置将成为导航视图的根控制器的视图的边界和框架。
2. 按下后通过导航控制器设置同一视图的边界和框架。
就是这样。一切正常。还应该调整 shouldAutorotateToInterfaceOrientation: 方法以在方向更改期间设置框架。
I did a very simple mistake. It is like i should set the bounds and frame of the view and the that of the navigation bar's view.
1. set bounds and frame of the view which is going to be the rootcontroller of the navigation view.
2. After pushing set the bounds and frame of the same view via navigation controller.
Thats it. Things work fine. The shouldAutorotateToInterfaceOrientation: method should also be tweaked to set the frame during the orientation changes.