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.
这是我用于视图控制器的 UILabel 标题的代码:
UIFont *bebasFont = [UIFont fontWithName:@"Bebas" size:100]; RestaurantsTitle.font = bebasFont; RestaurantsTitle.text = @"RESTAURANTS";
我需要扩大标题字母之间的空间,但我不知道该怎么做。
如果可能的话,为文本字段而不是框架设置宽度也可以吗?
我需要扩大字母之间的空间
使用 NSAttributedString 并增加字符串的字距。
https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSAttributedString_Class/index.html
https://developer.apple.com/library/ios/documentation/UIKit/Reference/NSAttributedString_UIKit_Additions/index.html#//apple_ref/doc/c_ref/NSKernAttributeName