Falcon
Falcon

Reputation: 1463

UIScrollView doesn't scroll with all constraints

I'm learning ios and trying to make my first UIscrollview interface. It's a simple app with 3 inputs, one button and sum label. Here is my view hierarchy: view hierarchy

I set up the constraints like this: constraints

But, then I switch a simulator to the horizontal orientation I can't scroll to the bottom of the container view to see the sum label.

Where is the problem? I have no Content size Amiguity warning.

Code can be found here: https://www.dropbox.com/s/3pemzl2695g26li/Calculator.zip?dl=0

Thanks!

Upvotes: 0

Views: 64

Answers (2)

Kalp
Kalp

Reputation: 153

enter image description hereYou have implemented wrong constraints in side the view. just change two constraints.enter image description here

Upvotes: 1

Anshul Bhatheja
Anshul Bhatheja

Reputation: 693

I have checked your code on my system. You have to follow the steps below to make your view scroll in horizontal/landscape orientation:

  1. Delete the equal height constraint from the view that you have inside the scroll view.
  2. Add the bottom constraint on the label where the sum(total of 3 inputs) is being displayed. This constraint will calculate the height of the view inside the scroll view, not the equal height constraint.

Please make these changes and run your code. If you still got any issue in scrolling the view then let me know, I will upload the code to dropbox. I suggest you to follow some good tutorials regarding the constraints as you have applied some wrong constraints as well.

Upvotes: 1

Related Questions