Ios7 在iOS 7不工作的情况下,在mono touch中将iPhone方向从纵向模式更改为横向模式

Ios7 在iOS 7不工作的情况下,在mono touch中将iPhone方向从纵向模式更改为横向模式,ios7,xamarin.ios,uiinterfaceorientation,Ios7,Xamarin.ios,Uiinterfaceorientation,我在单点触摸应用程序中工作,在该应用程序中,我通过自动旋转将视图从纵向模式切换到横向模式。 为此,我在iPhone上为纵向和横向视图创建了两个xib文件。 最初以纵向模式加载视图是正确的。但如果将旋转更改为横向模式,则无法加载视图 public override bool ShouldAutorotate() { return false; } public override UIInterfaceOrientationMask GetSupportedI

我在单点触摸应用程序中工作,在该应用程序中,我通过自动旋转将视图从纵向模式切换到横向模式。 为此,我在iPhone上为纵向和横向视图创建了两个xib文件。 最初以纵向模式加载视图是正确的。但如果将旋转更改为横向模式,则无法加载视图

public override bool ShouldAutorotate()    
{     
    return false;     
} 

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()     
{  
    return UIInterfaceOrientationMask.All;         
}    
如何从加载xib文件中将视图从纵向更改为横向

public override bool ShouldAutorotate()    
{     
    return false;     
} 

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()     
{  
    return UIInterfaceOrientationMask.All;         
}    
请通读下面的片段

public override bool ShouldAutorotate()    
{     
    return false;     
} 

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()     
{  
    return UIInterfaceOrientationMask.All;         
}    
在Appdelegate.cs中

public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
    // create a new window instance based on the screen size
    window = new UIWindow (UIScreen.MainScreen.Bounds);     
    viewController = new LoginViewControl ();           
    gonavigate = new UINavigationController (); 
    gonavigate.PushViewController (viewController, true);
    this.window.RootViewController = viewController;
    window.MakeKeyAndVisible ();     
    return true;
}

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations (UIApplication application, UIWindow forWindow)
{       
    ipadviewController = new LoginViewControlipad();
    gonavigate.PushViewController (ipadviewController, true);   
    return UIInterfaceOrientationMask.All;
}
public override bool ShouldAutorotate()    
{     
    return false;     
} 

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()     
{  
    return UIInterfaceOrientationMask.All;         
}    
在ViewController中,我将覆盖以下方法:

public override bool ShouldAutorotate()    
{     
    return false;     
} 

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()     
{  
    return UIInterfaceOrientationMask.All;         
}