iphone - 如何在同一个 UITextField 或 UITextView 中保留两种不同的字体?

标签 iphone ios uitextfield uitextview

我想在同一个 UITextFieldUITextView 中设置 2 种不同的字体。怎么做?

最佳答案

需要做一些工作 - 您需要使用 Core TextNSAttributedString做这个。

有很多教程和示例,但我建议使用其他人已经制作的 UILabel 子类,例如:

OHAttributedLabel

TTAttributedLabel

因为这些通常有一些方便的方法来使处理更容易。

关于iphone - 如何在同一个 UITextField 或 UITextView 中保留两种不同的字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11583581/

相关文章:

iphone - UITextView TextView :shouldChangeTextInRange:replacementText: doesn't fire when deleting large portions of text?

iphone - 带有引用框架的 CoreMotion iOS 5 态度不起作用

ios - CocoonJS 适用于 iPhone(非 iPad)

ios - WKWebView媒体控件标题显示Url

ios - Swift 格式输入为 "as-you-type"格式的百分比

iphone - iOS应用内购买-下载或解锁新内容?

ios - 在 Storyboard之外创建一个 View Controller

ios - Swift 中带有 #define 宏的 Objective-C 代码

ios - 设置 UITextField 的最大 int 值(不是字符数)

ios - 在 UITextField 中输入满分 10 分?