2014-06-14 48 views
4

我做了一個UIViewController像ShouldAutorotate和GetSupportedInterfaceOrientations不叫Xamarin.iOS

public class MyViewController : UIViewController 
{ 
    ... 

    public override bool ShouldAutorotate() 
    { 
     return true; 
    } 

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

和AppDelegate.cs使用它。

Window.RootViewController = new MyViewController(); 

當我運行此代碼,「ShouldAutorotate」和「GetSupportedInterfaceOrientations」被稱爲鑑於初始化階段多次,但經過應用視圖中顯示,他們再也沒有叫。

我檢查了Info.plist中的方向設置是否有效。 iOS SDK Target爲7.1,Xamarin Studio Version爲5.0.1(build 3),Xamarin.iOS版本爲7.2.3.39。

任何想法?

回答

0

iOS會在視圖加載並緩存顯示期間使用的答案時檢查這些視圖。