AlexB
AlexB

Reputation: 3548

Placing a UIView under a UIScrollView with autolayout

How can I display a UIView under a UIScrollview with autolayout ?

I have a scrollview and a UIView below it(the grey box in image below). Adding it has a footer inside the scrollview is not what I want because as you can see I have tabs that can scroll horizontally... The same view needs to be under each tabs. I programatically add child view's to my scroll view.

Is it possible to put a UIView outside the uiscrollview ? If not, how can I add it above every child view at the bottom ?

I have tried messing around with the constraints but nothing worked. I am stuck.

Thanks in advance !

Storyboard :

enter image description here

ScrollView constraints :

enter image description here

UIView constraints :

enter image description here

Upvotes: 1

Views: 488

Answers (1)

AlexB
AlexB

Reputation: 3548

I found the solution. You need to drag a UIView above the UIScrollView and add a space to the top and bottom layout. Also, I added a leading and trailing space constraint.

Upvotes: 0

Related Questions