我想以编程方式检测 ipad 上的旋转过程。在这种情况下,我想在旋转开始时将布尔值设置为 yes,并在旋转结束后将其设置为 false。是否有任何方法在旋转开始和旋转结束时调用?
来自苹果文档:
在用户界面开始旋转之前发送到视图控制器。
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
用户界面旋转后发送到视图控制器:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
在这里查看更多内容:UIViewController 类参考 -> 响应视图旋转事件 http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html
注意力:这已被弃用,请参阅这个帖子 https://stackoverflow.com/a/25965511/1953914
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)