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];
    }];
相關文章
相關標籤/搜索