gualizoe
gualizoe

Reputation: 159

Align Text View to top when having a large title navigarion bar

I have a View Controller inside a Navigation Controller. My View Controller only has a Text View which takes up the whole screen.

I've also set the prefersLargeTitles to true in the View Controller:

navigationController?.navigationBar.prefersLargeTitles = true

What I'd like to do is align the Text View to the top. I've tried placing it at the top and setting the top auto-layout to 0, but then the large title is not appearing. The way I managed it to appear, is not aligning it to the top, but a little bit lower:

enter image description here

But then it's not correctly displayed. You can see a small gap between the title and the text:

enter image description here enter image description here

What's the right way to do it then?

Upvotes: 0

Views: 407

Answers (1)

gualizoe
gualizoe

Reputation: 159

I've just solved my own question by aligning the Text View top to the top (not the safe area top). Now it's working just how I wanted to.

(Thanks @nathan :) )

Upvotes: 1

Related Questions