// 字体的大小
CGSize size = [title sizeWithAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:14.0f]}];
CGSize adjustedSize = CGSizeMake(ceilf(size.width), ceilf(size.height));
加上向上取整 ceilf()就能解决了.
本文介绍了一种使用 Objective-C 调整字体大小的方法,并通过 ceilf() 函数实现向上取整,确保字体显示效果更佳。
// 字体的大小
CGSize size = [title sizeWithAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:14.0f]}];
CGSize adjustedSize = CGSizeMake(ceilf(size.width), ceilf(size.height));
加上向上取整 ceilf()就能解决了.
1776

被折叠的 条评论
为什么被折叠?