1. OS >= iOS 8.01
2
3FZLoginViewController *fzLoginViewController = [[FZLoginViewController alloc] init];
fzLoginViewController.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:fzLoginViewController animated:NO completion:nil];
2. 若系统需兼容7.0 需要加处理1
2
3
4
5
6
7
8if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
controller.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[self presentViewController:controller animated:YES completion:nil];
} else {
self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:controller animated:NO completion:nil];
self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationFullScreen;
}
iOS 模态跳转推出透明背景方法
-------------本文结束感谢您的阅读-------------