Hiding UINavigationItem's bar button

后端 未结 11 984
粉色の甜心
粉色の甜心 2021-01-04 07:04

I have added a BarButton item to the left of the nav.bar through Interface Builder and in the code I want this only to show in my table view\'s edi

11条回答
  •  借酒劲吻你
    2021-01-04 07:05

    I'm pretty sure the only way to "hide" it is to nil it out.

    self.navigationItem.leftBarButtonItem = nil;
    

    Though it's not a perfect answer to your question, since that basically gets rid of your button instead of hiding it. You'll either have to recreate it or keep your original button around and simply set the leftBarButtonItem back to your UIBarButtonItem.

提交回复
热议问题