刮奖效果
刮獎效果
?
效果
?
說明
刮獎效果使用了開源的 Scatch & See 控件.
?
源碼
https://github.com/YouXianMing/Animations
https://github.com/moqod/iOS-Scratch-n-See
// // ScratchImageViewController.m // Animations // // Created by YouXianMing on 15/12/22. // Copyright ? 2015年 YouXianMing. All rights reserved. // #import "ScratchImageViewController.h" #import "MDScratchImageView.h" #import "UIView+SetRect.h" #import "UIImage+ImageEffects.h"@interface ScratchImageViewController ()@end@implementation ScratchImageViewController- (void)setup {[super setup];self.titleView.backgroundColor = [UIColor whiteColor];self.contentView.layer.masksToBounds = YES;UIImage *image = [UIImage imageNamed:@"1"];// 背景圖片UIImageView *blurImageView = [[UIImageView alloc] initWithFrame:(CGRect){CGPointZero, image.size}];blurImageView.image = image;blurImageView.center = self.contentView.middlePoint;[self.contentView addSubview:blurImageView];// 被刮的圖片MDScratchImageView *scratchImageView = [[MDScratchImageView alloc] initWithFrame:blurImageView.frame];[scratchImageView setImage:[image blurImage] radius:20.f];[self.contentView addSubview:scratchImageView]; }@end
?
細節
?
轉載于:https://www.cnblogs.com/YouXianMing/p/5065576.html
總結
- 上一篇: 个人所得税计算器2016 by Jack
- 下一篇: iOS 导航栏遮挡问题 --- iOS