我们可以将Font设置为字符串吗?
一般在xcode编程中,我们可以设置Font、Labels、TextFields等等。 那么我们可以用同样的方式将字体设置为字符串(NSString)吗?
Generally in the xcode programming, we can set Font to Labels,TextFields and many more.
Well in the same way can we set font to a string(NSString)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不 -
NSString
只是一个字符串。您看到的是字符串的表示。而且,这与实际的字符串是分开的。就像 NSDate 只是一个日期一样,但是您呈现它的方式是通过NSDateFormatter
。您正在寻找的是 NSAttributedString 类。
No - An
NSString
is just, well, a string. What you are looking at is the presentation of a string. And, this is separate from the actual string. In the same way that NSDate is just a date, but the way you present it is through anNSDateFormatter
.What you are looking for is the NSAttributedString class.