zzheads
zzheads

Reputation: 1472

Change color and back button title of Navigation Bar from Swift 3 code

Making UI of my app using code only. Can't find how customize couple elements: 1. Button 'Back' now it looks like:

enter image description here

and it should looks like:

enter image description here

So, how I can get rid of 'Back' text from button title, keeping '<' system icon there? And how I can change colors of back button and title of navigation bar?

Upvotes: 2

Views: 6527

Answers (4)

hoss24
hoss24

Reputation: 556

With XCode 12.3 can change the Title Color and Back Button using the following.

Change Title Color

Change Back Button Color

Upvotes: 0

Mehedi Hasan
Mehedi Hasan

Reputation: 369

Follow the instruction from your xcode. You can do this easily. I also marked on the image . Select 1. Select the Standard Editor, 2. Show the File inspector 3 Set global Ting

From your Xcode you can do this

Upvotes: 0

Daniel Dramond
Daniel Dramond

Reputation: 1598

try

    self.navigationController?.navigationBar.tintColor = UIColor.white

Upvotes: 9

Fabbou
Fabbou

Reputation: 28

Try:

override func viewDidLoad(){
    //any other initial stuffs

    //for the bar
    navigationController?.navigationBar.tintColor = UIColor.black
    //for the button
    navigationController?.navigationBar.backItem?.titleView?.tintColor = UIColor.white
}

Upvotes: 0

Related Questions