self.instructionsString = @"1:说明1\n2:说明2\n3:说明3";
_instructionsLabel = [[UILabel alloc] init];
_instructionsLabel.text = self.instructionsString;
_instructionsLabel.textColor = [UIColor grayColor];
_instructionsLabel.numberOfLines = 0;
//计算文字有多少行
CGFloat labelHeight = [_instructionsLabel sizeThatFits:CGSizeMake(SCREEN_W-20, MAXFLOAT)].height;
_hang = (labelHeight) / _instructionsLabel.font.lineHeight;
// NSLog(@"%ld", (long)_hang);
网友评论