Frage

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

War es hilfreich?

Lösung

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;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top