使用presentViewController 弹出半透明ViewController覆盖在原ViewController上
SecondViewController *VC = [[SecondViewController alloc] init];
if ([[[UIDevice currentDevice] systemVersion] floatValue]>=8.0)
{
VC.modalPresentationStyle=UIModalPresentationOverCurrentContext;
}
else
{
self.modalPresentationStyle=UIModalPresentationCurrentContext;
}
[self presentViewController:VC animated:YES completion:nil];
注意iOS 8 上下 modalPresentationStyle设置的对象是不一样的。
把要弹出的ViewController的背景设置为透明即可。