desclabel.width = self.view.width - (leftOffset*2);
desclabel.lineBreakMode = NSLineBreakByWordWrapping;
desclabel.numberOfLines = 0;
[desclabel sizeToFit];

  1.规定高度

  2.设置lineBreakMode

  3.设置行数为0

  4.执行sizeToFit

效果iOS UILabel:宽度固定,自动高度显示全部文字-LMLPHP

04-14 16:52