Swift — Ignore safe area when using UIScrollView

ODENZA
Apr 19, 2022

--

We will show you how to ignore safe area when using UIScrollView.

Problem:

When we use UIScrollView, It can’t ignore safe area by default. or even you set the constraints of scrollView to the superView.

Solved:

Set content inset by programmatically.

yourScrollView.contentInsetAdjustmentBehavior = .never

or set it in your storyboard

Result:

--

--

ODENZA
ODENZA

No responses yet