2017-01-11 15 views

答えて

-1

でテキストを編集します。

オンラインでWYSIWYG html iosを検索して、どのライブラリが最適かを調べることができます。たとえば、ZSSRichTextEditorはiOSのリッチテキストエディタです。 UITextViewを変換し、出力htmlを変更する追加のボタンを取得するだけです。 (太字、下線、色など)

+0

NSString * str = textView.attributedText; –

0

TextViewは単純なテキストを表示できます。 あなたはUIWebViewでhtmlを表示できます。

+1

TextViewは任意のテキストを表示できます。 HTML文字列を含む。 – NSNoob

0
NSAttributedString *articleText = _txtView.attributedText; 

NSDictionary *documentAttributes = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType}; 

NSData *htmlData = [articleText dataFromRange:NSMakeRange(0, articleText.length) documentAttributes:documentAttributes error:NULL]; 
NSString *str = [[NSString alloc] initWithData:htmlData encoding:NSUTF8StringEncoding]; 
NSLog(@"%@", str); 
関連する問題