【发布时间】:2012-12-23 09:29:17
【问题描述】:
我想获取设备的当前方向。我在 AppDelegate 类中编写了这段代码: 我的代码:
if (UIInterfaceOrientation.LandscapeLeft == (UIInterfaceOrientation)UIDevice.CurrentDevice.Orientation &&
UIInterfaceOrientation.LandscapeRight == (UIInterfaceOrientation)UIDevice.CurrentDevice.Orientation) {
//code
} else {
//code
}
UIDevice.CurrentDevice.Orientation 给出未知数?
【问题讨论】:
-
请注意,您的上述条件将始终为假,因为
Orientation不能同时LandscapeLeft和LandscapeRight。除此之外,更多信息将有助于了解您的问题。
标签: ios6 xamarin.ios c#-3.0 ios-simulator