Reputation: 190
I am working on a project, i have a navigation bar of height 129 now I need to add a bar button Item to my navigation bar. My problem is with the bar button position i want to change the position of bar button item.
This is an image of what is happening:
This shows the position for where i want it:
Upvotes: 0
Views: 993
Reputation: 185
Very specific situation but you can try set image insets for bar button item.
let image = UIImage(named: "yourImage")
let leftButton = UIBarButtonItem(image: image, style: .plain, target: self, action: #selector(self.leftButtonDidPressed))
leftButton.imageInsets = UIEdgeInsets(top: -64, left: 0, bottom: 0, right: 64)
self.navigationItem.leftBarButtonItem = leftButton
Upvotes: 1