【问题标题】:presentViewController transparent background doesn't work on iPad 4presentViewController 透明背景在 iPad 4 上不起作用
【发布时间】:2015-10-02 12:15:32
【问题描述】:

我尝试打开一个具有透明背景的弹出窗口,以便我们可以看到弹出窗口后面的屏幕。 我使用此代码:

- (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];
}
}

除了背景是黑色的 ipad 4 之外,这一切都很好。我也试过添加

vc.view.backgroundColor = [UIColor clearColor];

但是背景仍然是黑色的... 任何的想法? 谢谢

【问题讨论】:

    标签: ios objective-c ipad retina


    【解决方案1】:

    这可能会帮助您解决问题。

    vc.modalPresentationStyle = UIModalPresentationCurrentContext;
    

    【讨论】:

    • 不,没有任何变化:(
    猜你喜欢
    • 1970-01-01
    • 2021-10-13
    • 2015-04-25
    • 1970-01-01
    • 1970-01-01
    • 2016-06-14
    • 1970-01-01
    • 2011-07-26
    • 2011-07-28
    相关资源
    最近更新 更多