IOS 背景模糊化

复制代码
 UIView *effectView = [[UIView alloc] initWithFrame:CGRectMake(10, 70, 300, 100)];
    effectView.tag = 100;
    effectView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:effectView];
    
    UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
    visualEffectView.frame = effectView.bounds;
    [effectView addSubview:visualEffectView];
   以为是IOS8的方法,所以最好加上判断
  [[[UIDevice currentDevice] systemVersion] floatValue] >=8.0
复制代码
 
posted @   NSFuck  阅读(269)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示