iOS开发-应用管理

时间:2023-03-09 15:08:43
iOS开发-应用管理

//

//  ViewController.m

//  21-应用管理-1

//

//  Created by hongqiangli on 2017/8/2.

//  Copyright © 2017年 李洪强. All rights reserved.

//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {

[super viewDidLoad];

//添加第一个格子

//创建

UIView *appView = [[UIView alloc]init];

CGFloat appViewX = 20;

CGFloat appViewY = 30;

CGFloat appViewW = 100;

CGFloat appViewH = 120;

appView.frame = CGRectMake(appViewX, appViewY, appViewW, appViewH);

[self.view addSubview:appView];

appView.backgroundColor = [UIColor redColor];

//创建

UIView *appView1 = [[UIView alloc]init];

CGFloat appView1X = appViewX + appViewW + 40;

CGFloat appView1Y = 30;

CGFloat appView1W = 100;

CGFloat appView1H = 120;

appView1.frame = CGRectMake(appView1X, appView1Y, appView1W, appView1H);

[self.view addSubview:appView1];

appView1.backgroundColor = [UIColor blueColor];

}

- (void)didReceiveMemoryWarning {

[super didReceiveMemoryWarning];

}

@end