IOS-UI-UILable, iosuilabel automatic line feed
// Used for text display
UILabel * label = [[UILabel alloc] initWithFrame: CGRectMake (10, 30,200,300)];
// Use the color tester to select the color
Label. backgroundColor = [UIColor colorWithRed: 26/255. f green: 124/255. 0 blue: 248/255. 0 alpha: 1];
Label. text = @ "I'm from China, this is a beautiful place"; // text
Label. textColor = [UIColor whiteColor]; // font color
Label. font = [UIFont systemFontOfSize: 18]; // system font size
// Label. font = [UIFont boldSystemFontOfSize: 18]; // Add the system font to the blacklist
// Customize the font
// Label. font = [UIFont fontWithName: <# (NSString *) #> size: <# (CGFloat) #>]; // Custom font. The first parameter indicates the font name, the second parameter indicates the size.
Label. numberOfLines = 0; // line feed setting (0 indicates that the default setting is invalid)
Label. lineBreakMode = NSLineBreakByCharWrapping; // (multiple) line feed (line Break Mode)
Label. textAlignment = NSTextAlignmentLeft; // Alignment)
// You need to activate (allow Operation) to set the text
Label. shadowColor = [UIColor blackColor]; // The shadow color of the text)
Label. shadowOffset = CGSizeMake (2, 2); // shadow offset of Text
Label. enabled = NO; // whether to activate it. The default value is YES.
// Set the tag
Label. tag = 1;
// Label. transform = CGAffineTransformMakeRotation (0.4); // sets the degree of text skew (transform conversion)
[Self. view addSubview: label];
[Self setLabelText];
}
// Set to replace the new text
-(Void) setLabelText {
// Obtain the view of the tag
// UILabel * label = (UILabel *) [self. view viewWithTag: 1];
// Label. text = @ "new text ";
}