xcode iOS 无法隐藏工具栏 UIbarButtonItem

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10869382/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:28:34  来源:igfitidea点击:

iOS unable to hide toolbar UIbarButtonItem

iphoneobjective-ciosxcodecocoa-touch

提问by Jaume

I am unable to find the way to hide a UIbarButtonItem set on a toolbar. The button is properly declared and linked on IB. However the following line does nothing,

我无法找到隐藏工具栏上设置的 UIbarButtonItem 的方法。该按钮已在 IB 上正确声明和链接。然而下面这行什么都不做,

self.botoVolver = nil;

回答by bradley

Just reset the button on the toolbar, try this:

只需重置工具栏上的按钮,试试这个:

[self.toolbar setItems:nil];