Hi I am trying to set UITextView height as per content. Its working fine for adjusting frame of UITextView.

But coming to text is missing as like below image shown. This happn only in iOS7 . Its displaying well in iOS6. If i tap on textview i started to edit the textview complete text is dispalying.

I wrote the fllowing lines of code` notesField.text = [editWellObject objectForKey:@"Notes"];

// Adjusting Frame as per text
CGSize size = [notesField sizeThatFits:CGSizeMake(notesField.frame.size.width, FLT_MAX)];
CGRect frame = notesField.frame;
float difference = size.height - frame.size.height;
frame.size.height = size.height;
notesField.frame = frame; 

Please help me in this issue. Thanks in Advance. enter image description here

有帮助吗?

解决方案

Few days back I was struggling with the same issue and I have found solution with resetting property scrollEnable from NO to YES. Following is my code snippet

    internalTextView.scrollEnabled = NO;
    if (newSizeH >= maxHeight)
        internalTextView.scrollEnabled = YES;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top