stay iOS UILabel is a commonly used control in programming. Here is a way to set the relevant properties of UILabel.
Many iOS 6 programming starts with storyboard, and when UILabel is used, controls are dragged into storyboard to generate implementations. If you want to use code in - (void)viewDidLoad, such as [_label]. InititWithFrame: The CGRectMake (X, Y, WIDTH, HEIGHT)] method does not work by changing the label size dragged onto storyboard, because the program loads with the code of -(void)viewDidLoad first, and then loads storyboard. Storyboard generates label according to the size set when dragging the control, that is, it overrides the label in -(void) viewDidL. The size set in oad, so to dynamically set the size of label, you should use code to create UILabel.
- UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(50, 50, 200, 400)];
- [self.view addSubview:label];
Or use the following code to change the size of label
- label.frame = CGRectMake(97, 47, 223, 19);