实现部分代码关于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];
}
原文地址:http://www.cnblogs.com/gzy0724/p/3834485.html