- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *redView = [[UIView alloc] init];
redView.frame=CGRectMake(0, 100, 100, 200);
redView.backgroundColor=[UIColor greenColor];
[self.view addSubview:redView];
UIView *greenView =[[UIView alloc]init];
greenView.frame=CGRectMake(100, 100, 100, 200);
greenView.backgroundColor=[UIColor redColor];
[self.view addSubview:greenView];
UIView *blackView =[[UIView alloc]init];
blackView.frame=CGRectMake(200, 100, 100, 200);
blackView.backgroundColor=[UIColor blackColor];
[self.view addSubview:blackView];
这是国旗吗?
时间: 2024-10-19 01:58:17