Ios6 需要解决MonoTouch中与方向相关的问题

Ios6 需要解决MonoTouch中与方向相关的问题,ios6,xamarin.ios,c#-3.0,ios-simulator,Ios6,Xamarin.ios,C# 3.0,Ios Simulator,我想获取设备的当前方向。我在AppDelegate类中编写了以下代码: 我的代码: UIDevice.CurrentDevice.Orientation提供未知信息?能否使用UIViewController的InterfaceOrientation属性 这可能是一个更好的检查值,因为它是您的应用程序当前旋转且“允许”旋转的状态。检查UI设备可能与UI的旋转不匹配。请注意,由于方向不能同时显示LandscapeLeft和LandscapeRight,因此上述条件始终为假。除此之外,更多的信息将有助

我想获取设备的当前方向。我在AppDelegate类中编写了以下代码: 我的代码:


UIDevice.CurrentDevice.Orientation提供未知信息?

能否使用
UIViewController的
InterfaceOrientation
属性


这可能是一个更好的检查值,因为它是您的应用程序当前旋转且“允许”旋转的状态。检查
UI设备
可能与UI的旋转不匹配。

请注意,由于
方向
不能同时显示
LandscapeLeft
LandscapeRight
,因此上述条件始终为假。除此之外,更多的信息将有助于理解您的问题。
if (UIInterfaceOrientation.LandscapeLeft == (UIInterfaceOrientation)UIDevice.CurrentDevice.Orientation &&
            UIInterfaceOrientation.LandscapeRight == (UIInterfaceOrientation)UIDevice.CurrentDevice.Orientation) {
            //code
        } else {
            //code
        }