2

i am setting large title to navigation bar and then on right side i am adding two buttons but button not set to the center with large title my code is as below

Code

navigationController?.navigationBar.prefersLargeTitles = true
title = "Record"

let settingImage    = UIImage(named: "ic_Setting")!
let infoImage  = UIImage(named: "ic_Info")!

let settingButton   = UIBarButtonItem(image: settingImage,  style: .plain, target: self, action: nil)
let infoButton = UIBarButtonItem(image: infoImage,  style: .plain, target: self, action: nil)

navigationItem.rightBarButtonItems = [infoButton, settingButton]

i put above code inside viewDidLoad() and here is my screen shot which out put i am getting form above code and other screen shot which is my expected output

This is my output i get from above code:

This is my output i get from above code

I want output like this:

I want output like this

so please help me how to center buttons with title

Paolo Mossini
  • 1,064
  • 2
  • 15
  • 23
Hussy
  • 23
  • 5
  • https://stackoverflow.com/questions/45317963/adjust-position-of-bar-button-item-when-using-large-titles-with-ios-11 – Dilan Apr 20 '20 at 06:28
  • 1
    Does this answer your question? [Adjust position of bar button item when using large titles with iOS 11](https://stackoverflow.com/questions/45317963/adjust-position-of-bar-button-item-when-using-large-titles-with-ios-11) – Magnas Apr 20 '20 at 06:30
  • i go throught this link but i have multiple button on right side thats why i am confus how to manage multiple buttons – Hussy Apr 20 '20 at 06:31

0 Answers0