How to use UIBlurEffect with modal View Controllers?

后端 未结 6 2322
夕颜
夕颜 2021-02-13 14:17

I have a UIViewController that presents another UIViewController modally. I want the modal view controller to have the blur/transparency that iOS 7 int

6条回答
  •  故里飘歌
    2021-02-13 14:59

    Thanks to @YarGnawh. This tested on iOS 8

    UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
    UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
    [blurEffectView setFrame:self.view.bounds];
    self.tableView.backgroundView = blurEffectView;
    

提交回复
热议问题