文本视图/界面生成器中的自定义字体

发布于 2025-01-08 12:57:50 字数 200 浏览 6 评论 0原文

我希望这是一个非常简单的问题,但它难倒了我。基本上,我有大量的文本正在使用文本视图。在大多数情况下,这只是系统字体。但是,我想使用自定义字体(我已添加到我的项目中)和背景颜色来格式化大块文本中的每隔几个段落的“标题”。如何定位文本视图中的小块文本?

如果它只是一小段文本,我只需添加一个标签并用代码来完成,但由于这是一大段文本,最好的方法是什么?

谢谢!

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神妖 2025-01-15 12:57:50

如果你加载大量带有格式的静态文本,我建议你将其保存为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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文