- (void)viewDidLoad
{
[super viewDidLoad];
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(240, 20, 60, 35)];
label.text = @"Hello";
label.backgroundColor = [UIColor blueColor];
//子视图label加Autoresizing
label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
[self.view addSubview:label];
}