开发者

text editor in uitextview

开发者 https://www.devze.com 2023-02-27 00:05 出处:网络
I need to build an editor where 开发者_如何学Cuser can edit any part of the text. I mean he can bold, underline or change the fonts of any part of text. I know it is not possible to do it in UITextVie

I need to build an editor where 开发者_如何学Cuser can edit any part of the text. I mean he can bold, underline or change the fonts of any part of text. I know it is not possible to do it in UITextView, but is there any alternative to achieve this?


See this Apple sample here called CoreTextPageViewer, and note that a WWDC 2010 video is available on iTunes for developers, called "Advanced Text Handling for Iphone OS".

Also, you might want to also look at this sample code from Apple.


Why not try CoreText !


UIWebView only allow you just display the Rich content means you can not edit.

Check this will be useful for you


How about using a UIWebView and embedding an HTML editor?


hi pankaj It is very much possible with text view . you have to make your own editor


There are two common ways how people are doing rich text editing on iOS right now:

  1. UIWebView plus JavaScript
  2. Custom View implementing UITextInput for input and CoreText for rendering

But both are quite involved. Unfortunately Apple seems to have left out selection mechanics from UITextInput, so you would have to program all of this yourself.


On iOS 6, UITextView now supports rich text.
Look at the attributedText property:

@property(nonatomic,copy) NSAttributedString *attributedText
0

精彩评论

暂无评论...
验证码 换一张
取 消