f ([[[UIDevice currentDevice] systemVersion] floatValue]>=8.0) {
nextVC.modalPresentationStyle=UIModalPresentationOverCurrentContext;
}else{
self.modalPresentationStyle=UIModalPresentationCurrentContext;
// 此处的self-----> 猜测指的是 弹出 nextVC 的控制器 可以是[UIApplication sharedApplication]..keyWindow.rootViewController
}
[self presentViewController: nextVC animated:YES completion:nil];
以上已经过测试 非常好用 下面是 如果以后还碰到上面的问题 但是不能用了 就试试下面的
第一种:
- YLSLockScreenViewController *lockScreenController = [[YLSLockScreenViewController alloc] init];
- lockScreenController.modalPresentationStyle = UIModalPresentationFormSheet;// 窗口
- [self.mainViewController presentViewController:lockScreenController animated:YES completion:^(void){
- lockScreenController.view.superview.backgroundColor = [UIColor clearColor];// 背景色透明
- }];
第二种:
ios7:
presentingVC.modalPresentationStyle = UIModalPresentationCurrentContext;
ios8:
modalVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
modalVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
and then in both:
[presentingVC presentViewController:modalVC animated:YES completion:nil];