简体   繁体   English

iOS11 backBarButtonItem已禁用

[英]iOS11 backBarButtonItem disabled

Before iOS11 , I use the runtime replaced the backBarButtonItem implementation change the default back button style, effects as follows, but on the iOS11 is invalid. iOS11之前,我使用运行时替换了backBarButtonItem实现,更改了默认的后退按钮样式,效果如下,但是对iOS11无效。

影响

I found that the structure of the back button below before iOS11 我发现iOS11之前的后退按钮结构

影响

But The structure of the back button on the iOS11 below 但是下面的iOS11上的后退按钮的结构

在此处输入图片说明

How can I get on iOS11 before implementation effect, which means backBarButtonItem without words? 如何在实现效果之前进入iOS11,这意味着没有单词的backBarButtonItem

Try this: 尝试这个:

self.navigationController?.navigationBar.topItem?.title = ""

wrire this code in viewDidLoad(). 将此代码存储在viewDidLoad()中。

Its affected in NextViewController. 其影响在NextViewController中。

If you want only backButton without the words, try going through following steps: 如果只希望backButton不带单词,请尝试执行以下步骤:

  1. Embed your second ViewController to NavigationController too. 也将第二个ViewController嵌入到NavigationController中。
  2. Drag and Drop a UIBarButton icon to the NavigationBar of Second ViewController. 将UIBarButton图标拖放到Second ViewController的NavigationBar中。
  3. Add the backbutton image to the UIBarButton. 将后退按钮图像添加到UIBarButton。

It's Done!! 完成!!

Hope it will help you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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