Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以设置 UIFont 高度和行距吗?我用谷歌搜索了这个,似乎没有办法为 IOS 内置字体设置高度。一种可能的方法是使用自定义字体。这似乎太重了,因为我只想设置行距和高度。提前致谢!
一旦你UIFont从 iOS 获得了一个给定大小的实例,你以后就不能再改变大小了。因为它将其所有属性定义为readonly.
UIFont
readonly
您可以使用属性访问 Caps 和 Lower 的字符高度。
@property(nonatomic, readonly) CGFloat xHeight @property(nonatomic,readonly) CGFloat lineHeight @property(nonatomic, readonly) CGFloat capHeight