NSLineBreakMode enumeration meaning:
NSLineBreakByWordWrapping = 0 / / with the word for the display unit, the back part omit does not display. NSLineBreakByCharWrapping / / keep the whole character, and character for display unit, the back part omitted don't show NSLineBreakByClipping / / shear and the contents of a text width is the same length, in the second part is deleted, simple clipping, By the end of world NSLineBreakByTruncatingHead / / the front part of the text to... Way to omit, the text shows the tail NSLineBreakByTruncatingTail / / the content of end... Way to omit, according to the head of the content of text content among NSLineBreakByTruncatingMiddle / /... The way to omit, display the beginning and end of the text contentCopy the code
Common problem scenarios:
-
Label Mixing Chinese and number results in line breaks
/ / solution label. LineBreakMode = NSLineBreakByCharWrapping;Copy the code
-
Not yet!