码迷,mamicode.com
首页 > 移动开发 > 详细

iOS找色块游戏

时间:2015-07-27 09:30:29      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

//

//  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找色块游戏

标签:

原文地址:http://blog.csdn.net/jzq_sir/article/details/47079533

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!