NSString *string1 = @"helloworld";
CGSize fontSize = [string1 sizeWithAttributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15]}];
NSLog(@"the fontSize is %@", NSStringFromCGSize(testSize));
NSLog(@"the testSize is %@", NSStringFromCGSize(testSize));
iOS 使用系统API获取 字符串的 size
原创mb646b2b3c1359c 博主文章分类:iOS_UI ©著作权
©著作权归作者所有:来自51CTO博客作者mb646b2b3c1359c的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
redis 集群怎么清理数据
Redis 简介 redis是一种开源的、基于内存的、可持久化的、高性能的Key-Value数据存储系统。 redis能做什么? 持久化存储 高速缓存 消息中间件
redis 集群怎么清理数据 数据库 操作系统 lua redis