The problem is this: title bar for some reason is not displayed in the center on some controllers.

http://i053.radikal.ru/1703/fb/ddc916172974.png

The first thought was that it was because of a long title. Not.

Firstly, this controller can be reached in two ways, and if you go to it by the second way, then the title is displayed normally.

Secondly, this screenshot is made on iphone SE. On the iphone 7+, for example, this controller looks fine, but here's another controller that looks normal on the SE, 7+ again is buggy:

http://s020.radikal.ru/i709/1703/ab/6dd3dbcf56a7.png

As you can see, there is already a short name.

Above said that the first controller shown can be reached in two ways. I thought that something could be here, but both methods are absolutely identical, that is, the same push-transition is both there and there.

I tried to put the title of the title through the navigationItem in the Storyboard, and in the code:

override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationItem.title = "Акции" } 

Also, I tried to create a custom title in this place, that is, to create a UIView, to push the text onto it and assign it to navigationBar.titleView. As a result, a custom view is also crookedly displayed.

On real devices I also tried to run - the same thing.

I can not imagine what could be wrong. Surely this is some kind of eplovsky bug, but how do I get around it?

  • Behavior is similar to absolute edge alignment. - Artyom Okonechnikov
  • Can you attach a sample project where this problem is reproduced? - VAndrJ
  • @ArtyomOkonechnikov on the second screen is not clear then why the edge is so close to the center, and not near the right side of the screen, but still try to register. - Denis Petrov
  • @VAndrJ, unfortunately, no. Work project .. - Denis Petrov

1 answer 1

Everything, the question is removed. To remove the title from backButton, I simply shifted it upstairs and forgot that it exists at all. And it turns out that's how it looks:

http://s018.radikal.ru/i503/1703/55/9cca859f9c1d.png

Oh, this way from beginner to pro ...