iOS 实现刮刮乐效果demo剑客篇(欢迎提建议和分享经验)
2014-12-15 10:03
423 查看
#import "AppDelegate.h"
#import "FeelHapplyVC.h"
@interface
AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
*)launchOptions {
//设置根控制器
FeelHapplyVC *vcFeelHapp = [[FeelHapplyVC
alloc] init];
self.window.rootViewController = vcFeelHapp;
// Override point for customization after application launch.
return
YES;
}
#import "FeelHapplyVC.h"
#import "STScratchView.h"
@interface
FeelHapplyVC ()
@property (nonatomic,
strong) STScratchView *scratchView;
@end
@implementation FeelHapplyVC
- (void)viewDidLoad {
[super
viewDidLoad];
// Do any additional setup after loading the view.
//更换背景颜色
[[self
view] setBackgroundColor:[UIColor
grayColor]];
//添加背景图片视图
UIImageView *bg_imageView = [[UIImageView
alloc]
initWithFrame:CGRectMake(0,
0, self.view.frame.size.width,
self.view.frame.size.height)];
bg_imageView.image = [UIImage
imageNamed:@"asdfjogin.jpg"];
[bg_imageView setContentMode:UIViewContentModeScaleToFill];
[self.view
addSubview:bg_imageView];
//设置覆盖view视图
UIView *mainView = [[UIView
alloc] initWithFrame:self.view.bounds];
[mainView setBackgroundColor:[UIColor
clearColor]];
//被覆盖区域视图
UITextView *testTV = [[UITextView
alloc]
initWithFrame:CGRectMake(self.view.bounds.size.width
- 150,
48, 138,
433)];
testTV.text =
@"我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!";
testTV.textColor = [UIColor
whiteColor];
testTV.backgroundColor = [UIColor
orangeColor];
[self.view
addSubview:testTV];
//遮挡的imageview
UIImageView *imageView = [[UIImageView
alloc] initWithFrame:CGRectMake(self.view.bounds.size.width
- 150, 48,
138, 433)];
[imageView setBackgroundColor:[UIColor
clearColor]];
[imageView setContentMode:UIViewContentModeScaleToFill];
[imageView
setImage:[UIImage
imageNamed:@"95C2B035D"]];
[mainView
addSubview:imageView];
_scratchView = [[STScratchView
alloc]
init];
[_scratchView
setContentMode:UIViewContentModeScaleAspectFit];
[_scratchView
setFrame:self.view.bounds];
[_scratchView
setBackgroundColor:[UIColor
clearColor]];
[_scratchView
setSizeBrush:30.0];
[mainView
addSubview:imageView];
[_scratchView
setHideView:mainView];
[[self
view] addSubview:_scratchView];
}
DEMO免费下载地址:http://download.csdn.net/detail/u012113447/8260365
#import "FeelHapplyVC.h"
@interface
AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
*)launchOptions {
//设置根控制器
FeelHapplyVC *vcFeelHapp = [[FeelHapplyVC
alloc] init];
self.window.rootViewController = vcFeelHapp;
// Override point for customization after application launch.
return
YES;
}
#import "FeelHapplyVC.h"
#import "STScratchView.h"
@interface
FeelHapplyVC ()
@property (nonatomic,
strong) STScratchView *scratchView;
@end
@implementation FeelHapplyVC
- (void)viewDidLoad {
[super
viewDidLoad];
// Do any additional setup after loading the view.
//更换背景颜色
[[self
view] setBackgroundColor:[UIColor
grayColor]];
//添加背景图片视图
UIImageView *bg_imageView = [[UIImageView
alloc]
initWithFrame:CGRectMake(0,
0, self.view.frame.size.width,
self.view.frame.size.height)];
bg_imageView.image = [UIImage
imageNamed:@"asdfjogin.jpg"];
[bg_imageView setContentMode:UIViewContentModeScaleToFill];
[self.view
addSubview:bg_imageView];
//设置覆盖view视图
UIView *mainView = [[UIView
alloc] initWithFrame:self.view.bounds];
[mainView setBackgroundColor:[UIColor
clearColor]];
//被覆盖区域视图
UITextView *testTV = [[UITextView
alloc]
initWithFrame:CGRectMake(self.view.bounds.size.width
- 150,
48, 138,
433)];
testTV.text =
@"我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!我被挡住了,快来解救我!!";
testTV.textColor = [UIColor
whiteColor];
testTV.backgroundColor = [UIColor
orangeColor];
[self.view
addSubview:testTV];
//遮挡的imageview
UIImageView *imageView = [[UIImageView
alloc] initWithFrame:CGRectMake(self.view.bounds.size.width
- 150, 48,
138, 433)];
[imageView setBackgroundColor:[UIColor
clearColor]];
[imageView setContentMode:UIViewContentModeScaleToFill];
[imageView
setImage:[UIImage
imageNamed:@"95C2B035D"]];
[mainView
addSubview:imageView];
_scratchView = [[STScratchView
alloc]
init];
[_scratchView
setContentMode:UIViewContentModeScaleAspectFit];
[_scratchView
setFrame:self.view.bounds];
[_scratchView
setBackgroundColor:[UIColor
clearColor]];
[_scratchView
setSizeBrush:30.0];
[mainView
addSubview:imageView];
[_scratchView
setHideView:mainView];
[[self
view] addSubview:_scratchView];
}
DEMO免费下载地址:http://download.csdn.net/detail/u012113447/8260365
相关文章推荐
- iOS 两种方式实现瀑布流效果剑客篇(欢迎提建议和分享经验)
- iOS 侧拉抽屉效果mmdrawercontroller剑客篇(欢迎提建议和分享经验)
- iOS 插件管理工具之Alcatraz插件剑客篇(欢迎提建议和分享经验)
- iOS 真机测试之初级剑童篇较新版(欢迎提建议和分享经验)
- iOS 开发使用半透明模糊效果方法整理(欢迎分享和提建议)
- iOS 系统控件UITableView使用之初级剑童篇(欢迎提建议和分享遇到的问题)
- iOS 控件之UITextField及键盘挡住处理方法(欢迎大家提建议和分享)
- 照片管家iOS-实现本地相册、视频、安全保护、社交分享源码下载Demo
- iOS UITableViewCell重用机制理解之初级剑侠篇(欢迎提建议和分享遇到的问题)
- IOS UI学习 UITableView Demo 实现类似QQ联系人收起和展开效果
- 使用Swift实现iOScollectionView广告无限滚动效果(DEMO)
- IOS开发基础之C语言程序实现迷宫游戏,分享给大家,欢迎讨论
- iOS 语法之Blocks使用初级剑童篇(欢迎提建议和分享遇到的问题)
- iOS 网络请求框架MKNetworkKit使用方法(欢迎提建议和分享遇到的问题)
- iOS 防止崩溃之代码保护注意措施初级剑侠篇(欢迎提建议和分享遇到的问题)
- iOS 浅淡自动布局剑童篇(欢迎提意见和分享经验)
- iOS开发 刮刮乐效果的实现
- 源码推荐(9.16):一个实现QQ空间和Path个人主页的景深效果DEMO,iOS 流式自动布局适配All Screen
- iOS 图片缓存框架SDWebImage使用方法(欢迎提建议和分享遇到的问题)
- iOS 网络请求框架AFNetworking使用方法(欢迎提建议和分享遇到的问题)