label.lineBreakMode=UILineBreakModeWordWrap;
下面是lineBreakMode的样式属性:
typedefenum {
UILineBreakModeWordWrap = 0, // Wrap at word boundaries
UILineBreakModeCharacterWrap, // Wrap at character boundaries
UILineBreakModeClip, // Simply clip when it hits the end of the rect
UILineBreakModeHeadTruncation, // Truncate at head of line: "...wxyz". Will truncate multiline text on first line
UILineBreakModeTailTruncation, // Truncate at tail of line: "abcd...". Will truncate multiline text on last line
UILineBreakModeMiddleTruncation, // Truncate middle of line: "ab...yz". Will truncate multiline text in the middle
} UILineBreakMode;
xib中的设置: