UIView

创建UIView,在一个视图上增加一个视图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// ViewController.m
// 2UIView
//
// Created by wanggang on 2017/8/4.
// Copyright © 2017年 hackingangle. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// x,y,width,height
UIView *subview = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 50)];
subview.backgroundColor = [UIColor blueColor];
[self.view addSubview:subview];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
文章目录
,