直接上代码 - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(10, 50, 100, 50)]; view1.backgroundColor = [UIColor blueColor]; [self.v