Different transition on presentModalViewController:animated:

风流意气都作罢 提交于 2019-11-30 09:58:18

I did not understand what your plight with the different color backgrounds is about. Opaque backgrounds on your views, especially animating ones, make the app run faster. Now about transitions, before you call presentModalViewController, insert one of the following lines:

modelViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
modelViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
modelViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
modelViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl;

Any of the above will change the transition style (though the PartialCurl will result in a white bit of the last view still present in the top corner; it seems to be undocumented, though it's used by the Maps app). You may have to play with what the modalTransitionStyle gets set on.

Sliding in from the left or right is part of the navigation controller. Changing backgrounds is probably not what you want when working with the navigation controller.

Also, that extra strip above the model view is going to show up no matter which way you transition in. It's annoying, but it can be over come as follows:

- (void)viewDidLoad {
    [super viewDidLoad];
    navigationController.view.frame = CGRectMake(0, 0, 320, 460); //<--This line
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!