문제

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