您的位置:首页 > 移动开发 > IOS开发

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 =
@"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐