0

For a long title on iOS 11, the back button arrow and text are not showing.

I searched for a solution and the closest I got was navigation bar rightbaritem image-button bug iOS 11

It looks like this
as it looks with a long title
When it should look like this for long titles also
the back button should show as it does with a short title
My problem though is that I don't have an explicit button added, instead the titleview pushes the "< Back" default leftBarButtonItem that I create:

navigationItem.backBarButtonItem = UIBarButtonItem(title: NSLocalizedString("Back", comment: ""), style: .plain, target: nil, action: nil)

How can I add constraints to that (UIBarButtonItem)?

Zsolt
  • 3,648
  • 3
  • 32
  • 47
  • You should be setting constraints on custom views add to `UIToolbar`s (i.e. your `titleView`) There is no way to add constraints directly to a `UIBarButtonItem` – beyowulf Oct 26 '17 at 19:14

1 Answers1

0

I ended up lowering the compression resistance of the titleviews text, so the bar button items have higher priorities and everything fell in place.

Zsolt
  • 3,648
  • 3
  • 32
  • 47