2
UITextView를 내부 텍스트로 확장하려면 어떻게해야합니까? 당신이 시도 할 수UITextView를 만드는 방법 Notes 응용 프로그램과 같은 텍스트로 펼치기
UITextView를 내부 텍스트로 확장하려면 어떻게해야합니까? 당신이 시도 할 수UITextView를 만드는 방법 Notes 응용 프로그램과 같은 텍스트로 펼치기
...
UITextView *textView; // your UITextView
NSString *text; // the text that you want to place in the UITextView
UIFont *textViewFont; // the font that you are using for your UITextView
CGSize size = {255,2000.0f}; //The default width, and max height you want to use
CGSize newSize = [text sizeWithFont:textViewFont
constrainedToSize:size lineBreakMode:UILineBreakModeWordWrap];
textView.frame = CGRectMake(0,0,newSize.width, newSize.height);
이 시도 할 수 있습니다 ..
CGRect frame = textView.frame;
frame.size.height = [textView contentSize].height;
textView.frame = frame;