iPhone: Fade transition between two RootViewControllers

后端 未结 3 4030
北海茫月
北海茫月 2021-02-20 19:07

Obj-C or MonoTouch C# answers are fine.

The initial UIWindow\'s RootViewController is a simple login screen.

window.RootViewCon         


        
3条回答
  •  别跟我提以往
    2021-02-20 19:33

    This is MT code of @Robert Ryan's technique (although I agree with his suggestion that theAppScreen is probably the "correct" RootViewController):

    void DissolveIn (UIWindow window, UIViewController newController)
    {
      newController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
      window.RootViewController.PresentViewController (newController, true, () => 
      {
        window.RootViewController.DismissViewController (false, null);
        window.RootViewController = newController;
      });
    }
    

提交回复
热议问题