设备旋转时的新视图
当 iPhone / iPod Touch 旋转到横向模式并带有翻转动画时,我想调用“presentmodalviewcontroller”。当它旋转回纵向时,我想再次呈现第一个视图,再次使用翻转动画。
无法在网络上找到可用的东西:(
我相信你可以帮助我:) 多谢 ! 塞巴斯蒂安
I want to call "presentmodalviewcontroller" when the iPhone / iPod Touch is rotated to landscape mode with a flip animation. When it gets rotated back to portrait, I want to present the first view again, again with the flip animation.
Weren't able to find something working on the web :(
I'm sure you can help me :)
Thanks a lot !
Sebastian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试监听 UIDeviceOrientationDidChangeNotification 通知:
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(deviceOrientationDidChange:) name: UIDeviceOrientationDidChangeNotification object: nil];
当您登上它时,请出示您的控制器。
Try listening for the UIDeviceOrientationDidChangeNotification notification:
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(deviceOrientationDidChange:) name: UIDeviceOrientationDidChangeNotification object: nil];
When you get on it, present your controller.
在您的 UIViewController 中,接受所有界面方向:
您的控制器将开始接收旋转消息,例如:
以及
您可以对旋转做出反应并执行诸如呈现/关闭模态视图控制器之类的操作。
In your UIViewController, accept all interface orientations:
And your controller will start receiving rotation messages, like:
and
Where you can react to rotation and do things like present/dismiss modal viewcontrollers.