美文网首页
iOS present出有透明度的ViewController

iOS present出有透明度的ViewController

作者: 可bing | 来源:发表于2020-12-09 15:56 被阅读0次

    presentingViewController:

    UIViewController *vc = [UIViewController new];
    [self presentViewController:vc animated:YES completion:nil];
    

    presentedViewController:

    - (instancetype)init {
        self = [super init];
        if (self) {
            self.modalPresentationStyle = UIModalPresentationCustom;//采用自定义呈现方式
            self.modalTransitionStyle = UIModalTransitionStyleCoverVertical;//采用从低往上动态覆盖的方式转场
        }
        return self;
    }
    - (void)viewDidLoad {
        [super viewDidLoad];
        self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4];//设置透明度
    }
    

    相关文章

      网友评论

          本文标题:iOS present出有透明度的ViewController

          本文链接:https://www.haomeiwen.com/subject/hjphgktx.html