0

I am creating my first ios app but having some difficultly with a simple ui layout. I am trying to have a simple registration form.

I have a number of UITextField like name, email, address and finally a submit Button etc and have added them to a StackView.

This is a portrait application and the trouble is 1, I can't get the stackview to fill horizontally. (I can't seem to adjust the width) 2, When running in the simulator I can't scroll. If the there are too many text fields for the screen the user can't scroll to the next fields or button.

Here is a shot of what I currently have enter image description here

How should this kind of view be organised ?

Glenn Pierce
  • 720
  • 1
  • 6
  • 18
  • 1
    Your question is not according to stack overflow guidelines, Please check question asking guidelines of stack overflow. – Divyanshu Sharma Apr 09 '19 at 10:08
  • First, add constraints to the stack view to get it to stretch horizontally. Second, `UIStackView` does not have any "scrolling" capabilities... you would probably want to add it as a subview of a `UIScrollView`. – DonMag Apr 09 '19 at 12:56

1 Answers1

0

stackView don't contain what you mean in his property you can check https://developer.apple.com/documentation/uikit/uistackview

The stack view uses Auto Layout to position and size its arranged views. The stack view aligns the first and last arranged view with its edges along the stack’s axis.

you should using UITextFieldDelegate to auto scroll to next textField by calling becomeFirstResponder(). check: How to move to the next UITextField automatically in Swift