码迷,mamicode.com
首页 > 移动开发 > 详细

iOS7 iOS8 毛玻璃效果的分别实现

时间:2015-02-09 12:30:55      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

 

iOS8用系统的,

iOS7用第三方的(效果还是挺快的.)

https://github.com/KiranPatel-iOS/KPBlurEffect

 

 

 

[_headBGIV sd_setImageWithURL:headIVURL
                        completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
                            if (IOS8_OR_LATER)
                            {
                                UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
                                UIVisualEffectView *effectview = [[UIVisualEffectView alloc] initWithEffect:blur];
                                effectview.frame = _headBGIV.bounds;
                                [_headBGIV addSubview:effectview];
                            }
                            else
                            {
                                _headBGIV.image = [image applyDarkEffect];
                            }
                            
                            // 动画显示
                            NSString *aniType = kCATransitionFade;
                            CATransition *fadeAni = [CATransition animation];
                            fadeAni.duration = 0.68f;
                            fadeAni.type = aniType;
                            fadeAni.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
                            [[headView layer] addAnimation:fadeAni forKey:nil];
                        }];

  

iOS7 iOS8 毛玻璃效果的分别实现

标签:

原文地址:http://www.cnblogs.com/willbin/p/4281123.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!