0
votes

I have a strange issue, I am using IOS6 and I am trying to get a UIScrollView to resize based upon the content within it, there are 3 UITextView (2 fixed and 1 dynamic height). The problem seems to be that when you scroll down the scroll view the UITextView with the dynamic height will revert back to the previous height set in Interface Builder. I have placed the code below to show how I am setting the scroll height and UITextView height.

- (void)viewDidAppear:(BOOL)animated {

CGRect frame = description.frame;
frame.size = description.contentSize;
description.frame = frame;

CGFloat scrollViewHeight = 0.0f;

scrollViewHeight = 160 + description.contentSize.height;

NSLog(@"%f",description.contentSize.height);

[scrollView setContentSize:(CGSizeMake(320, scrollViewHeight))];

}

To expand it seems that the UITextView will not expand into the scrollable area of the UIScrollView, instead it only goes to the initially set height of the scrollview

1

1 Answers

2
votes

It turns out that it was the layout constraints that were causing the issue.