简体   繁体   中英

swift 3 IOS - Back button issue

I'm trying to go from viewController to Another

my problem is that the back button is showing as "<" and not "< Back" and i didn't understand why, especially cause i'm able to go from this viewController to another one, and the back button is perfect

do anyone faced the same problem ? and how could i solve it ?

不看代码很难看,但是如果您想解决它,您可以看看有关如何更改后退按钮标题的许多其他答案。

This can happen if the title of the new view controller is too long. I think the system in this scenario will favor removing "back" in order to make room for the long title

So try shortening the view controller title

You can customize the text of the back button with the following code...

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

    // your segue prep code
    self.navigationController?.navigationBar.topItem?.title = "Back"


}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM