I am using the large title navbar with iOS 11, but when I add a bar button item it looks weird positioned in the same location as the original title navbar. I would like to move
What you want to do is set the title position adjustments of the BarButtonItem
. Add the following line to the viewWillAppear
func. Play with the vertical
and horizontal
value to get the layout
of ur liking.
navigationItem.rightBarButtonItem?.setTitlePositionAdjustment(.init(horizontal: 10, vertical: 20), for: UIBarMetrics.default)
https://developer.apple.com/documentation/uikit/uibarbuttonitem/1617149-settitlepositionadjustment