Steven Verheyen
Steven Verheyen

Reputation: 169

iOS - Top Layout Guide height issues

I am refactoring some views in my application regarding iPhone X constraints and moved a group of views into a TabBarController view with also a Navigation views. Everything working just fine but one thing. Well... There is always that "one issue left" thing, isn't?

So the issue that I have is that the Top Layout Guide is set high. And I don't want that. See screenshot about this issue.

enter image description here

I have set the top constraint of the labels "Maandag" and "Op afspraak" (top one) to 0. Well to the Top Layout Guide. All views that I converted to this TabBar view has this issue :( I am using Storyboards.

This is the result on device (same on all kind of devices) enter image description here

Thanks in advance!

Upvotes: 1

Views: 480

Answers (1)

jefflovejapan
jefflovejapan

Reputation: 2121

With iOS 11, Apple is deprecating top(bottom)LayoutGuide and switching to the safeAreaLayoutGuide. In code, you could pin your view using view.safeAreaLayoutGuide.topAnchor, but in storyboards you'll want to pin stuff to the safe area node inside your view controller's view:

interface builder safe area

Upvotes: 2

Related Questions