我可以在 UITextView 中使用多种字体样式吗? [英] Can I use multiple font style in UITextView?

查看:21
本文介绍了我可以在 UITextView 中使用多种字体样式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我认为这是不允许的,但如果有人已经取得并想要分享的话.我在输入文本时都需要这个,在显示时也需要这个.

谢谢

解决方案

你说得对,标准的 UITextView 不支持富编辑.目前有一些解决方案.

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

其次,这家伙一直在工作在自定义富文本编辑控件上,并根据可协商的许可协议提供它.

最后,您可以自己完成这一切,并创建一个实现 UITextInput 协议的编辑器控件.除了 Apple 文档之外,还有一些关于执行此操作的提示这里.

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.

Thanks

解决方案

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

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.

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 中使用多种字体样式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆