xcode 在 iPhone 中设计富文本区域

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8671174/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:51:33  来源:igfitidea点击:

Design rich text area in iPhone

iphonexcodetextboxrichtextbox

提问by Manish Agrawal

I want to design a rich text area for iPhone where user can enter text or multiple images such that when user attached image it just come after the text ends and after that continue to write text.
When user edits the text the image will also get adjustable according to it.

我想为 iPhone 设计一个富文本区域,用户可以在其中输入文本或多个图像,这样当用户附加图像时,它就在文本结束后出现,然后继续写入文本。
当用户编辑文本时,图像也将根据它进行调整。

Any suggestion how to achieve it.
Thanks

任何建议如何实现它。
谢谢

回答by Priya Chhabra

IOS 5.0 introduces editable UIWebView. This makes rich text editing in iphone less complicated.

IOS 5.0 引入了可编辑的 UIWebView。这使得 iphone 中的富文本编辑变得不那么复杂。

Just go through these tutorial's series http://ios-blog.co.uk/iphone-development-tutorials/rich-text-editing-a-simple-start-part-1/

只需浏览这些教程系列http://ios-blog.co.uk/iphone-development-tutorials/rich-text-editing-a-simple-start-part-1/

The best tutorials for rich text editing in IOS 5 !!!

IOS 5 中富文本编辑的最佳教程!!!

回答by Rob Napier

Today, your best bet for this IMO is a UIWebView. You should start by watching Session 511 ("Rich Text Editing in Safari on IOS") from WWDC 2011. You may want to start with one of the existing JavaScript solutions with good Safari support, such as TinyMCEor CKEditor, and adapt from there. This is all covered in the WWDC video.

今天,这个 IMO 的最佳选择是UIWebView. 您应该首先观看 WWDC 2011 中的 Session 511(“iOS 上的 Safari 中的富文本编辑”)。您可能希望从现有的具有良好 Safari 支持的 JavaScript 解决方案之一(例如TinyMCECKEditor )开始,并从那里进行调整。这在 WWDC 视频中都有介绍。