Search code examples
iosobjective-cuiscrollviewuistoryboard

How to use ScrollView with multiple textfields with some help of storyboard?


I am trying to put my all textfield on scrollview. My scrollView is not working on run time.


Solution

  • I am not clear what you want exactly.

    To work with scroll view in the interface and in autolayout, you need to add a scroll view in the view. After that you should add one content view(UIView) in the scroll view. Then start adding the text fileds in the content view.

    Give constraints for scroll view. Then give constraints for the content view. Then for all your text fields.

    If you want to scroll the scroll view vertically, give the constraint for width of the scroll view equal to the width of content view. This is required to set the content inset of the scroll view.

    Please refer this https://www.natashatherobot.com/ios-autolayout-scrollview/