iOS 7 dynamic blur effect like in Control Center

前端 未结 6 2069
Happy的楠姐
Happy的楠姐 2020-12-12 11:04

I\'m trying to make a controller that will be similar to Control Center in iOS7. From WWDC session #226 I\'ve learnt how to get blurred image with different effects

6条回答
  •  半阙折子戏
    2020-12-12 11:46

    You can use below code to apply blur effect on view.

    UIVisualEffect *blurEffect;
    blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
    
    UIVisualEffectView *visualEffectView;
    visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
    
    visualEffectView.frame = MYview.bounds;
    [MYview addSubview:visualEffectView];
    

提交回复
热议问题