Hiding UIBarbuttonItem of navigationcontroller swift

情到浓时终转凉″ 提交于 2019-12-06 11:31:42

问题


New to swift implemented sliding menu by learning from swrevealviewcontroller swift

now i want to hide the menu button i.e. UIBarButtonItem which opens the side menu. I have searched found most of place following code:

menuBtn.enabled = false

but it only disables the button and not hide it.

Please let me know what wrong i am doing here.


回答1:


If it's the left button :

self.navigationItem.leftBarButtonItem.enabled = false;


来源:https://stackoverflow.com/questions/33103482/hiding-uibarbuttonitem-of-navigationcontroller-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!