问题
I am looking for a sample project which should have basic rich text editing features (Bold,Italic,Underline,Alignment,Attaching images).
I went through Google search results there are several editors available for iOS
but those all are developed by using UIWebView
with HTML
. I am looking for the one which developed by using UITextView
along with new features in iOS 6
and 7
(NSAttributedString
, NSTextattAchment
)
Can please guide me if you know any open source code or tutorial?
Thanks in advance!
回答1:
There no sample project for rich text that available on iOS Dev website, However if you like a UITextView implementation there few open-source alternatives such as iOS-Rich-Text-Editor and FastTextView.
iOS-Rich-Text-Editor
RichTextEditor for iPhone & iPad that supports loads of extra such as Bold, Italic, Underline, StrikeThrough, Font, Paragraph Indent/Outdent etc. Check the example its uses UITExtview.
FastTextView
EGOTextView is a complete drop in replacement for UITextView, that adds support for Rich Text Editing.
回答2:
You should read SECoreTextView supported almost above also select, copy, paste https://github.com/kishikawakatsumi/SECoreTextView
回答3:
Apple used to have a CoreText sample project and when TextKit launched they had a sample project for that too. You can't search from them through the normal document library you need to use the legacy library
You can however checkout the textView part of the UICatelog and that should get you started. It is a textview with attributed text and is fully editable.
Also have a read through the text programming guide.
来源:https://stackoverflow.com/questions/24757011/rich-text-editor-in-ios