[英]How to tell the target interfaceOrientation in iOS 8?
由於willAnimateRotationToInterfaceOrientation
在iOS 8中已棄用(我們應該使用- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
),我如何知道用戶要旋轉的interfaceOrientation?
是的,我可以讀取size值來知道比例,但是它不能告訴我UIInterfaceOrientationLandscapeLeft
和UIInterfaceOrientationLandscapeRight
之間的區別。
正確地說,您正在接收此事件:
- (void)viewWillTransitionToSize:(CGSize)size
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator)
第二個參數是過渡協調器。 用它! 它具有targetTransform
屬性,該屬性可以告訴您將要發生的情況。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.