处理直接在关键窗口上子视图的 UIViewController 中的方向更改
我正在尝试在应用程序的关键窗口上子查看视图控制器的视图。我需要这样做,从应用程序中我将使用 [[UIApplication sharedApplication] keyWindow] 获取键窗口,然后将子视图视图控制器的视图发送到该窗口。但我没有在该视图控制器的 shouldRotateToInterface 方法中获得方向变化。它在初始化时触发一次,在释放时触发一次,但在旋转设备时不会触发。
我是否需要执行任何其他方法,如何随着设备方向的变化来转换视图控制器的视图?如果可能,请给我教程。
先感谢您 :)
I am trying to sub view a viewcontroller's view on key window of my application. I need to do it like in such a way that, from the app I will take the keywindow using [[UIApplication sharedApplication] keyWindow] and then will sub view a viewcontroller's view to that window. But I am not getting orientation changes in shouldRotateToInterface method of that viewcontroller. It fires once on initialization and one on dealloc but does not get fired on rotating the device.
Do I need to do any other method, How can I do transform of a view controller's view as the device orientation changes?.. Please give me tutorial if possible.
Thank you in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的术语有点不清楚,但您在
app delegate
中通常遵循的过程是:当您在 xcode 中创建新项目时,这是从 Apple 模板中获取的。这应该是您调用
shouldRotateToInterface
方法和各种其他方法所需的全部内容。It's a bit unclear with your terminology being a bit off in places but the procedure you normally follow in your
app delegate
is:This is taken from the Apple templates when you create a new project in xcode. This should be all you need to get your
shouldRotateToInterface
method and various other methods called.