// 自适应字体宽度
- (CGSize)customSizeWithFont:(UIFont *)font
{
CGSize size = [selfsizeWithAttributes:@{NSFontAttributeName:font}];
return size;
}
// 根据内容计算 Label 高度
- (CGFloat)adjustHeightWithContent:(NSString *)content
{
CGRect contentBounds = [content boundingRectWithSize:CGSizeMake(kScreenWidth - kEdgeInRegisterTreaty * 2,1000)
options:NSStringDrawingUsesLineFragmentOrigin
attributes:[NSDictionary
dictionaryWithObject:
[RMUtils defaultFont]
forKey:NSFontAttributeName] context:nil];
return contentBounds.size.height + 5;
}