I'm creating a canvas where I have UITextView
that receives content from a Web Service, I'd like to know how do I UITextView
resize according to the amount of content I get, without creating a Scroll in the text, only the View has a UIScrollView
that according to the size of the UITextView
it determines the size of the UIScrollView
on the screen, I managed to do but only when I change the content, the problem is that I will not change , because the content comes through a feed. Could someone help me?
-(void)textViewDidChange:(UITextView *)textView{
CGFloat fixedWidth = textView.frame.size.width;
CGSize newSize = [textView sizeThatFits:CGSizeMake(fixedWidth, MAXFLOAT)];
CGRect newFrame = textView.frame;
newFrame.size = CGSizeMake(fmaxf(newSize.width, fixedWidth), newSize.height);
textView.frame = newFrame;
}