OGeek|极客世界-中国程序员成长平台

标题: ios - iPhone中presentViewController时如何保持背景透明? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 13:15
标题: ios - iPhone中presentViewController时如何保持背景透明?

我想像 iPhone iOS6 中的 UIActivityController 一样保持背景透明 enter image description here

我尝试像这样清除颜色和不透明但背景总是黑色(iPhone iOS5 模拟器)

enter image description here

这是presentViewController代码:

    ShareViewController *controller = [[ShareViewController alloc] initWithNibName"ShareViewController_iPhone" bundle:nil];
    controller.delegate = self;

    [self presentViewController:controller animated:YES completion:^{
        NSLog(@"Activity complete");
    }];

请帮忙!谢谢!



Best Answer-推荐答案


看看你必须做的是在你提到的自定义 UIActionsheet 后面添加一个 UIView 。在这里您可以做的是保持 UIView 的背景颜色为白色,然后保持其 alpha = 0.5。

当您关闭 UIActionsheet 时,您也可以 removeFromSuperview 后面添加的 UIView

关于ios - iPhone中presentViewController时如何保持背景透明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18009084/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4