I have a requirement to allow the user to enter text in UITextView in multiple lines but when the keyboard is dismissed, we have to display the text in single line. Now, when the user taps on the UITextView,I need the text to be displayed in multiple lines again when the keyboard is in focus. I am able to achieve the first part and i am able to show the text in single line after dismissing the keyboard. But i am not able to show the text in multiple lines when the keyboard is in focus again. The text is still shown in single line when i have the keyboard in focus. I tried to change the maximum number of lines to 2 in the delegate methods but of no use.
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{
textView.textContainer.maximumNumberOfLines = 2;
return YES;
}
Any suggestions? Please help.