博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
刮奖效果
阅读量:4566 次
发布时间:2019-06-08

本文共 1151 字,大约阅读时间需要 3 分钟。

刮奖效果

 

效果

 

说明

刮奖效果使用了开源的 控件.

 

源码

////  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

你可能感兴趣的文章
Sliding Window Maximum
查看>>
Qt create 配置git版本管理
查看>>
数组的选择--固定大小数组模板array存在的意义!
查看>>
《文献管理与信息分析》第二章
查看>>
java 字符串的比较compareTo
查看>>
多栏布局与JS实现瀑布流
查看>>
[洛谷P1369]矩形
查看>>
解决IE使用css表达式模拟fixed效果时抖动问题
查看>>
Linux date命令使用方法
查看>>
[转]ANDROID JNI之JAVA域与c域的互操作
查看>>
AngularJS directive简述
查看>>
@1-5使用pandas保存豆瓣短评数据
查看>>
使用JDBC的批处理功能
查看>>
读MBProgressHUD源码
查看>>
JDBC连接ORACLE无法登陆java.sql.SQLException: ORA-01017: invalid username/password; logon denied...
查看>>
团队-学生成绩管理-设计文档
查看>>
MySQL可供选择的存储引擎
查看>>
UITableView
查看>>
【SSM 7】Mybatis底层封装思路
查看>>
mysql默认字符集问题
查看>>