Evgeniy Kleban
Evgeniy Kleban

Reputation: 6940

Prevent view from scrolling to navigation bar

At one of my view controllers I have behavior that I needed, at another one - not. "Correct" view controller's content doesn't overlap a status bar (20 points bar at top). For the second one I have another layout. Please take a look.

Correct layout:

enter image description here

Wrong:

enter image description here

Why is that happen and how could i fix it?

Upvotes: 0

Views: 119

Answers (1)

slxl
slxl

Reputation: 689

If you're using Auto-Layout - check your topmost constraint. It should define a relation between Top Layout Guide and your desired View, but not between your View and Superview.Top

And, of course, there shouldn't be any hardcoded frames or constants.

Something like this:

enter image description here

Upvotes: 2

Related Questions