MonoTouch SupportedInterfaceOrientations не найден

В MonoTouch 6.0.10 с SDK 6.1 у меня есть следующее в 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)».

Любое предложение приветствуется!

Счет.


person BillF    schedule 22.02.2013    source источник


Ответы (1)


UIViewController определяет GetSupportedInterfaceOrientations, который вы можете переопределить в своих подклассах UITabBarController и UINavigationController.

Сообщение об ошибке компилятора С# (и ваш код) показывает, что вам не хватает префикса Get.

person poupou    schedule 22.02.2013
comment
Спасибо Пупу. Ты просто опередил меня. Мы немного медлительны в южном полушарии. - person BillF; 22.02.2013
comment
Привет у меня тоже такая же проблема. Можете объяснить, как вы решили свою. - person User382; 10.06.2013