I am a little stuck with the ScrollView in Swift and Xcode 11.
My goal is a simple ScrollView with Labels and Textfields. Each label describes what the textfields are used for. For example there is a Label "Name", so you have to enter your name in the textfield under the label. For this I need a ScrollView because the App I am coding requires a few more information. When I am trying to put this in a ScrollView I am constantly getting the following error: "Scrollable content size is ambiguous to ScrollView".
In order to find help I searched the internet and for example found this question: UIScrollView Scrollable Content Size Ambiguity. Unfortunatly it didn't solve my problem. So I decided to create a small test project with the following: - I created a project as a Single View Application - I added a ScrollView to the ViewController - I clicked on the constrains-Button at the canvas - I selected 0,0,0,0 for leading/top/trailing/bottom. - I clicked on "add 4 Constrains - Now the warning appeared. Also the ScrollView was not resized to the ViewController... I don't know why. - I added a UIView inside the ScrollView and set the same constrains, this time according to the ScrollView. - The UIView (Content view) got an extra constrain: Equal width with the root view - Now I added two Buttons, one with the text "Hello" and the other one with "world" on it. - The "hello"-Button received the following constrains: 16 to leading, trailing and top, as well as a fixed height of 30. - The "world"-Button got the following constrains: 16 to bottom, leading, trailing and over a 1000 so you can scroll through the ScrollView.
After all these steps the error is still there and if I run the app the "hello"-Button is at the top of the screen and the "world"-Button is at the bottom and I can't scroll.
Can maybe anyone help me fixing this issue. I am looking forward to every answer! Thank you for your help in advance!