1
votes

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

1
Put all element in UIView. and also Put UIView in UIScrollview. so it will easy to apply constraints.Avijit Nagare

1 Answers

0
votes

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.