mic
mic

Reputation: 1273

ScrollView margins

I've been working with Xcode and Swift 3 for a couple of weeks and I keep encountering the same issue. When I have a UIScrollView with elements inside I always get a margin around the entire scroll view of about 20, this is even though all my constraints are set to 0 - so its pinned to all sides. I have copied code from various tutorials and read numerous StackOverflow posts but I just can't seem to sort this issue out.

My page is set out like this:

When I rotate the page it adjusts the size of everything perfectly using the auto layout stuff, but the margin is still there.

I have tried to manually adjust the size of the scroll view but whenever I run the app it makes no difference.

I am absolutely baffled how I can sort this issue.

A screenshot of my scrollview, more can be added if needed.

Scrollview layout

Upvotes: 0

Views: 2021

Answers (1)

James
James

Reputation: 36

Double click on a constraint and it will open up the detailed view which shows the first item, relation and second item.

Click on "Superview.Trailing Margin" and untick "Relative to Margin"

Upvotes: 2

Related Questions