2011-08-04 10 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];