将视图从横向旋转为纵向
我有一个视图,其 xib 处于横向模式。在我的一个视图控制器中,我想以横向模式显示视图,并且它正在工作 f9。在按钮上单击的另一个视图控制器中,我希望该视图从底部进入纵向到顶部所以基本上我需要将横向视图转换为纵向视图。我已经通过 shouldAuto 旋转方法完成了,但它不起作用。我已附上屏幕截图,以便更容易理解问题
横向视图将按原样出现。 请帮我解决这个问题 提前致谢!!
I ma having a view whose xib is in landscape mode.In my one view controller I want to show the view in landscape mode and it is working f9.In another view controller on a button click I want that view to come in portrait from bottom to top so basically I need to transform that landscape view to portrait view .I have done by shouldAuto rotate methodbut it does not work.i have attached the screenshot so that the question will be more understood
the landscape view is coming as it is .
Please help me in sort outing this problem
Thanks in advance!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 view did load 方法中编写以下代码
另外,在 XIB 中将视图框架设置为 480 X 320 而不是 320 X 480 。否则它将无法工作
您还可以在 XIB 中旋转视图。
write the following code in view did load method
Also In your XIB set the view frame as 480 X 320 in place of 320 X 480 . Otherwise it will not work
You can also rotate your view in XIB.