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]; }];
时间: 2024-10-12 03:51:00