草庐IT

currentOrientation

全部标签

objective-c - 如何获取 iPhone 的当前方向?

是否有特殊的方法来获取iPhone的方向?我不需要它的度数或弧度,我希望它返回一个UIInterfaceOrientation对象。我只需要它来进行像这样的if-else结构if(currentOrientation==UIInterfaceOrientationPortrait||currentOrientation==UIInterfaceOrientationPortraitUpsideDown){//Code}if(currentOrientation==UIInterfaceOrientationLandscapeRight||currentOrientation==UIIn

objective-c - 如何获取 iPhone 的当前方向?

是否有特殊的方法来获取iPhone的方向?我不需要它的度数或弧度,我希望它返回一个UIInterfaceOrientation对象。我只需要它来进行像这样的if-else结构if(currentOrientation==UIInterfaceOrientationPortrait||currentOrientation==UIInterfaceOrientationPortraitUpsideDown){//Code}if(currentOrientation==UIInterfaceOrientationLandscapeRight||currentOrientation==UIIn