iOS 8 毛玻璃效果

  UIImage *image = [UIImage imageNamed:@"icon"];
    UIImageView *bgView = [[UIImageView alloc] initWithImage:image];
    bgView.frame = CGRectMake(100, 300, 100, 100);
    [self.view addSubview:bgView];
    
    UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];
    UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
    blurView.frame = bgView.frame;
    [self.view addSubview:blurView];

 

posted on 2015-06-23 17:12  airy99  阅读(117)  评论(0编辑  收藏  举报