How to import fonts in a project
1. Import the downloaded fonts to the file
2. Add fonts to the plist file
3. If you do not choose to add to the project at the time of import, you need to add the imported fonts to the Project->build phases->copybundleresources.
4. Open the font in the mac , the title is the corresponding font name
Automatically determines the size of the Uilabel display based on content:
1. Determine the size of a container
A.width or height side fixed
B. Variable variables should be large enough eg: (300, 2000) (it is worth mentioning that if the range is not large enough, it will be truncated, and there is no ellipsis, but if the string is long enough and the range is large enough, it will exceed the screen)
2. Determine the calculated font
3. Call the Boundingrectwithsize method
Label.numberoflines = 0; Here is a multi-line display
To set the line wrapping method:
Label.linebreakmode = uilinebreakmodemiddletruncation;
enum {
Uilinebreakmodewordwrap = 0,
Uilinebreakmodecharacterwrap,
Uilinebreakmodeclip,
Uilinebreakmodeheadtruncation,
Uilinebreakmodetailtruncation,
Uilinebreakmodemiddletruncation,
} Uilinebreakmode; (truncation is the meaning of truncation, generally this is used in single-line display)
Set the shadow (this is the text and shadow)
Label.shadowcolor = [Uicolor Redcolor];
Label.shadowoffset = Cgsizemake (1.0,1.0);
It is worth mentioning that if you want to add a shadow to the entire space, to use the Layer property, all the visual effects on the UIView are implemented with this.
2016.01.18 UILabel