我可以在UITextView中使用多种字体样式吗?

编程入门 行业动态 更新时间:2024-10-26 11:22:11
本文介绍了我可以在UITextView中使用多种字体样式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我要求在UITextView中使用多种字体样式。单个Textview中的粗体,斜体和下划线文本。喜欢:

I have a requirement to use multiple font style in UITextView. Like Bold, Italic and Underline text in single Textview. Like:

一个字是粗体第二个可能是斜体第三个下划线根据用户选择。

One word is Bold second may be italic third Underline as per user selection.

我不喜欢我认为这是允许的,但如果有人已经实现并希望分享。我需要这一切,同时输入文字和显示时相同。

I don't think this is allowed to do but still if any one have achieved and want to share. I need this all while enter text and same while displaying.

谢谢

推荐答案

你是对的,标准的UITextView不支持丰富的编辑。目前有一些问题的解决方案。

You're right that the standard UITextView does not support rich editing. At the moment there are a few solutions to the problem.

Omni Group有在开源许可下发布了他们的iOS和Mac框架。其中包括一个非常强大的富文本编辑器(参见:OUIEditorFrame.m)。这些非常强大但也非常复杂。他们的样本iPad应用程序包含富文本编辑器示例。进一步的讨论可以在这里找到

The Omni Group has released their iOS and Mac frameworks under an open source license. These include a very powerful rich text editor (see: OUIEditorFrame.m). These are very powerful but also extremely complex. Their sample iPad app includes the rich text editor example. Further discussion can be found here

其次,这个人一直在开发一个自定义的富文本编辑控件,并根据可协商的许可协议提供它。

Secondly, this guy has been working on a custom rich text editing control and is offering it under a negotiable licensing agreement.

最后,你可以自己完成所有这一切并创建一个实现UITextInput协议的编辑器控件。除了Apple文档之外,还有一些关于此处的提示。

Finally, you can do it all yourself and create an editor control that implements the UITextInput protocol. Aside from the Apple documentation, there are some tips on doing this here.

更多推荐

我可以在UITextView中使用多种字体样式吗?

本文发布于:2023-11-06 14:42:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563977.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:样式   多种   字体   UITextView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!