文本视图/界面生成器中的自定义字体
我希望这是一个非常简单的问题,但它难倒了我。基本上,我有大量的文本正在使用文本视图。在大多数情况下,这只是系统字体。但是,我想使用自定义字体(我已添加到我的项目中)和背景颜色来格式化大块文本中的每隔几个段落的“标题”。如何定位文本视图中的小块文本?
如果它只是一小段文本,我只需添加一个标签并用代码来完成,但由于这是一大段文本,最好的方法是什么?
谢谢!
I hope this is a really simple question, but it's stumped me. Basically, I have a huge amount of text that I'm using the text view for. For the most part, it's just the system font. However, I would like to format "headers" every few paragraphs in the large chunk of text with a custom font (that I've added to my project) and background color. How do I target small pieces of text within the text view?
If it were just a small piece of text, I would just add a label and do it with code, but since this a huge piece of text, what's the best way to do it?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你加载大量带有格式的静态文本,我建议你将其保存为html文件并加载到UIWebView中。
If you load a large amount of static text with formatting, I suggest you save it as a html file and load it into UIWebView.