iPhone: Fade transition between two RootViewControllers

后端 未结 3 4029
北海茫月
北海茫月 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:44

    You can do this:

    window.RootViewController = theAppScreen;
    
    loginScreen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [theAppScreen presentModalViewController:loginScreen animated:NO];
    

    loginScreen can dismiss itself when done: [self dismissModalViewControllerAnimated:YES];

    The NO on the first animation will make the loginScreen appear without any visibility of the theAppScreen beneath it. The animated = YES on completion will provide the cross-dissolve.

提交回复
热议问题