Change a UIView Frame
问题 I have set a UIView in my storyboard and make it an outlet. @property (nonatomic, weak) IBOutlet UIView *testView; In the - (void)viewDidLoad method, I want to change its frame like this CGRect frame = self.testView.frame; frame.size.height = 2; self.testView.frame = frame; But it does not work. Anybody can tell me why? 回答1: You might enabled the autolayout in your project , if so the setFrame straightly won't work . Check here for more info Solution : Disable the autolayout, if you don't