iOS找色块游戏
2015-07-27 08:35
387 查看
//
// ViewController.m
// UI-找色块游戏
//
// Created by jzq_mac on 15/7/22.
// Copyright (c) 2015年 jzq_mac. All rights reserved.
//
#import
"ViewController.h"
@interfaceViewController ()
{
NSArray *colrList ;
UIView *bgView;
UILabel *label;
int fac;
int space;
int width;
int index;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
[selfinitData];
[selfcreatView :
fac];
[NSTimerscheduledTimerWithTimeInterval:2target:selfselector:@selector(creatViewAndButton)userInfo:nilrepeats:YES];
}
- (void)initData
{
fac =2;
space =10;
colrList =
@[[UIColorredColor],[UIColorwhiteColor],[UIColoryellowColor],[UIColorgreenColor],[UIColorbrownColor],[UIColorpurpleColor],[UIColorblueColor]];
}
- (void)creatView:(int)number
{
//
创建父视图
bgView = [[UIViewalloc]initWithFrame:CGRectMake(0,120,
CGRectGetWidth(self.view.frame),CGRectGetHeight(self.view.frame))];
bgView.backgroundColor = [UIColorblackColor];
bgView.layer.cornerRadius =15;
[self.viewaddSubview:bgView];
label = [[UILabelalloc]initWithFrame:CGRectMake(0,80,
375,
40)];
label.text =
@"
// ViewController.m
// UI-找色块游戏
//
// Created by jzq_mac on 15/7/22.
// Copyright (c) 2015年 jzq_mac. All rights reserved.
//
#import
"ViewController.h"
@interfaceViewController ()
{
NSArray *colrList ;
UIView *bgView;
UILabel *label;
int fac;
int space;
int width;
int index;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
[selfinitData];
[selfcreatView :
fac];
[NSTimerscheduledTimerWithTimeInterval:2target:selfselector:@selector(creatViewAndButton)userInfo:nilrepeats:YES];
}
- (void)initData
{
fac =2;
space =10;
colrList =
@[[UIColorredColor],[UIColorwhiteColor],[UIColoryellowColor],[UIColorgreenColor],[UIColorbrownColor],[UIColorpurpleColor],[UIColorblueColor]];
}
- (void)creatView:(int)number
{
//
创建父视图
bgView = [[UIViewalloc]initWithFrame:CGRectMake(0,120,
CGRectGetWidth(self.view.frame),CGRectGetHeight(self.view.frame))];
bgView.backgroundColor = [UIColorblackColor];
bgView.layer.cornerRadius =15;
[self.viewaddSubview:bgView];
label = [[UILabelalloc]initWithFrame:CGRectMake(0,80,
375,
40)];
label.text =
@"
相关文章推荐
- iOS开发-Day9-C的复习
- 三十而立,从零开始学ios开发(十八):Storyboards(下) - minglz - 博客园
- 三十而立,从零开始学ios开发(十七):Storyboards(上) - minglz - 博客
- 三十而立,从零开始学ios开发(十六):Navigation Controllers and Table
- 三十而立,从零开始学ios开发(十五):Navigation Controllers and Table
- 三十而立,从零开始学ios开发(十四):Navigation Controllers and Table Views(上) - minglz - 博客园
- 三十而立,从零开始学ios开发(十二):Table Views(上) - minglz - 博客
- 三十而立,从零开始学ios开发(十三):Table Views(下)Grouped and I
- 三十而立,从零开始学ios开发(十一):Tab Bars和Pickers - minglz - 博客
- 三十而立,从零开始学ios开发(八):Autorotation and Autosizing - min
- 十而立,从零开始学ios开发(七):Delegate,Action Sheet, Alert -
- 三十而立,从零开始学ios开发(四):IOS控件(1),Image View、Text Fie
- 三十而立,从零开始学ios开发(五):IOS控件(2),Slider - minglz -
- 三十而立,从零开始学ios开发(六):IOS控件(3),Segmented Control、
- 三十而立,从零开始学ios开发(二):Hello World! - minglz - 博客园
- iOS9应用隐私控制-外部调用
- ShareSDK [iOS常见问题] 关于使用QQ做第三方登录的问题!
- iOS Sprite Kit教程之真机测试以及场景的添加与展示
- iOS Sprite Kit教程之场景的设置
- iOS应用之间跳转