iOS 弹出透明窗体viewcontroller【兼容iOS8以上】

    UIViewController *controller = self.view.window.rootViewController;
    controller.modalPresentationStyle = UIModalPresentationCurrentContext;
    
    if (CURRENT_DEVICE >=8.0) {
        lockScreenController.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    } else {
        controller.modalPresentationStyle = UIModalPresentationCurrentContext;
    }
    
    [controller presentViewController:lockScreenController animated:YES completion:^{
        // 背景色透明
        lockScreenController.view.superview.backgroundColor = [UIColor clearColor];
    }];

 

 
posted @ 2015-06-26 17:37  swu_luo  阅读(315)  评论(0编辑  收藏  举报