1

在带有 SDK 6.1 的 MonoTouch 6.0.10 中,我在 tabbarcontroller 和 navigationcontroller 中有以下内容:

public override bool ShouldAutorotate()
{
    return true;
}

public override UIInterfaceOrientationMask SupportedInterfaceOrientations()
{
    var orientations = ParentViewController.GetSupportedInterfaceOrientations();
    foreach ( var controller in ViewControllers )
        orientations = orientations & controller.GetSupportedInterfaceOrientations();
    return orientations;
}

在 AppDelegate 我有:

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations (UIApplication application, UIWindow forWindow)
{
    return UIInterfaceOrientationMask.All;
}

在 FinishedLaunching 我有:

window.RootViewController = tabController;

在 tabbarcontroller 和 navigationcontroller 中,这会出现“HelloWorld.TabController.SupportedInterfaceOrientations() 被标记为覆盖但找不到合适的覆盖方法 (CS0115)”形式的错误。

任何建议表示赞赏!

账单。

4

1 回答 1

2

UIViewController定义GetSupportedInterfaceOrientations您可以在您的UITabBarControllerUINavigationController子类中覆盖的内容。

C# 编译器错误消息(和您的代码)显示您缺少Get前缀。

于 2013-02-22T02:45:15.887 回答