首页 > 代码库 > 高震宇作业
高震宇作业
实现部分代码关于view的德国国旗实现
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *blackView = [[UIView alloc] initWithFrame:CGRectMake(10, 50, 300, 50)];
blackView.backgroundColor = [UIColor blackColor];
[self.view addSubview:blackView];
UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(10, 100, 300, 50)];
redView.backgroundColor = [UIColor redColor];
[self.view addSubview:redView];
UIView *yellowView = [[UIView alloc] initWithFrame:CGRectMake(10, 150, 300, 50)];
yellowView.backgroundColor = [UIColor yellowColor];
[self.view addSubview:yellowView];
}