Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid showing "back" for back button when navigation title is long in Swift

There is a navigation in my project which I want to config it's navigation back item.
First case: When the UINavigation title is long the title of back button is set to "back"

replacing back button title to "back"

Second case: when it is longer this "back" is not shown.

delete back button title and just show back icon

But I want to show just back icon in the first case too.

like image 329
Bita Avatar asked Oct 17 '22 10:10

Bita


1 Answers

Swift 3 - Through Storyboard:

To make navigation bar back button have only back arrow and no "Back" text written, follow the steps:

Go to navigation bar of the root view controller(titled "Home" in screenshot below)enter image description here

Go to its attribute inspector. Set the back button to a space as shown below:

enter image description here

And that's it!!

This is the simulator screenshot:

enter image description here

Hope it helps!

like image 190
Mamta Avatar answered Oct 21 '22 08:10

Mamta