IOS计算字符串的长度和宽度
+ (CGSize ) width:(CGFloat)width heigth:(CGFloat)heigth content:(NSString *)content fontSize:(UIFont*)fontSize
{
CGSize maxSize=CGSizeMake(width, heigth);
CGSize contentSize=[content sizeWithFont:fontSize constrainedToSize:maxSize lineBreakMode:NSLineBreakByWordWrapping];
return contentSize;
}
CGSize size1 = [DYConstants width:220 heigth:1000 content:[self.giftInfo objectForKey:@"scope"] fontSize:[UIFont systemFontOfSize:14]];
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇:没有了
