[textLabel setFont:[UIFont systemFontOfSize:[UIFont systemFontSize]]];
[textLabel sizeToFit]; breakLineModeは全文表示系で。
複数行では
[message sizeWithFont:[self.label font] constrainedToSize:CGSizeMake(self.label.width, CGFLOAT_MAX) lineBreakMode:self.label.lineBreakMode];
widthのは一行しか使えない。
typedef enum { 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;