简体   繁体   English

presentViewController透明背景在iPad 4上不起作用

[英]presentViewController transparent background doesn't work on iPad 4

I try to open a popup with a transparent background so that we can see the screen behind the popup. 我尝试打开一个透明背景的弹出窗口,以便我们可以看到该弹出窗口后面的屏幕。 I use this code : 我使用此代码:

- (void)presentErrorMessageVC:(NSString *)message {

// Get error message vc
S6ErrorMessageVC *vc = [[S6ErrorMessageVC alloc] initWithNibName:@"S6ErrorMessageVC" bundle:nil message:message];

if (vc) {
    // Set delegate
    vc.delegate = self;

    // Present error message vc
    [self presentViewController:vc animated:NO completion:nil];
}
}

Which works perfectly, except for ipad 4, where the background is black. 除了背景为黑色的ipad 4以外,它都可以正常工作。 I've also tried to add 我也尝试添加

vc.view.backgroundColor = [UIColor clearColor];

But still the background is black... Any idea? 但是背景仍然是黑色的...知道吗? Thx 谢谢

这可以帮助您解决问题。

vc.modalPresentationStyle = UIModalPresentationCurrentContext;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM