美文网首页
根据文本的长度确定label的宽高

根据文本的长度确定label的宽高

作者: ljzza | 来源:发表于2018-04-25 16:39 被阅读0次
CGRect tempRect = [knowLabel.text boundingRectWithSize:CGSizeMake(YGScreenWidth - 20, 2000) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0]} context:nil];
NSLog(@"%@",tempRect.size.height);

相关文章

网友评论

      本文标题:根据文本的长度确定label的宽高

      本文链接:https://www.haomeiwen.com/subject/fiydlftx.html