标签:
//
// 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 =
@"
版权声明:本文为博主原创文章,未经博主允许不得转载。 标签: 原文地址:http://blog.csdn.net/jzq_sir/article/details/47079533