RileyDev
RileyDev

Reputation: 2525

Dynamic ScrollView with UITextView and UITextField

I have a UIView with a UIScrollView as a subview, which also has a UITextField and a UITextView as a subview.

The problem I am facing is I want the UITextField to scroll up when the user scrolls down.

Should I change the UITextView to a static height dynamic to the length of text and then change the UIScrollView to the height of both the UITextView + UITextField, if so how ?

Or more simply put how can I have the subviews of the UIScrollView to scroll dynamically ?

Upvotes: 0

Views: 170

Answers (1)

Luke
Luke

Reputation: 26

For the scrollview to scroll you need to make its contents larger than the view.

Assuming the UITextField is above the UITextView, could you make the height of the UITextView larger than the UIView so you can then scroll the contents?

I have followed the tutorial for UIScrollViews which might be helpful.

Upvotes: 1

Related Questions