My UISrollView has subviews which include a textview, following by a uilabel, followed by an imageview.
The textview expands downwards, and has its own scrolling disabled.
I have a method which detects when the textview gets a new line, and it is supposed to expand the height of the textView, which it does
CGRect frame = _textView.frame;
frame.size.height = height + 10.0; //Give it some padding
_textView.frame = frame;
[self layoutIfNeeded];
the problem arises where the other elements positioned below the textview do not also expand downwards.
I've tried re-adding my constraints to those additional subviews, before the [self layoutIfNeeded]
method, but nothing happens visually.
If you look at the Twitter 'new tweet' functionality on iOS, you will see a textView, followed by an imageView, and the textview expands when you type, and everything is pushed down, this is also in a scrollview. I am trying to create similar functionality but running into issues.
How do I fix my problem, since my solution is ineffective? Any insight appreciated