2011-08-04 16 views

答えて

1

デフォルトでは、これを行わない場合は、UITextViewをサブクラス化してdrawRectメソッドを上書きする必要があります。

+0

くださいUITextViewのサブクラスを作成する方法上の任意のチュートリアル? – awlcs

+1

新しいクラスを作成し、UIViewから継承してください。その後、.hファイルの@interface行をUIViewからUITextViewに変更し、drawRectメソッドで独自の描画を行います。 –

1

あなたが作成し、HTML文字列を使用して、このような方法で、UITextViewを使用するのUIWebViewのinsteaadでそれを読み込むことができます。

NSString * htmlString = [NSString stringWithFormat:@"<html><head><script> document.ontouchmove = function(event) { if (document.body.scrollHeight == document.body.clientHeight) event.preventDefault(); } </script><style type='text/css'>* { margin:0; padding:0; } p { color:black; font-family:Helvetica; font-size:14px; } a { color:#63B604; text-decoration:none; }</style></head><body><p>%@</p></body></html>", yourText]; 
webText.delegate = self; 
[webText loadHTMLString:htmlString baseURL:nil]; 
関連する問題