/**
获取行数
self 代表UILabel
*/
-(NSInteger)getLabelLineNum{
CGFloat labelHeight = [self sizeThatFits:CGSizeMake(self.frame.size.width, MAXFLOAT)].height;
NSNumber *count = @((labelHeight) / self.font.lineHeight);
return [count integerValue];
}
网友评论