how to disable a navigation bar button item in iOS

前端 未结 16 1344
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-01 09:54

I have created a navigation controller. In the second view (which is pushed), I have some webservice call and placing a overlay view and setting

self.view.use

16条回答
  •  攒了一身酷
    2021-01-01 10:08

    Latest Swift: To hide the back button, you MUST use:

    self.navigationItem.setHidesBackButton(true, animated: false)
    

    Note: This can trigger a bug in the navigation bar that can cause an artifact to appear in place of a hidden back button when transitioning to a view that doesn't have a back button (or has a leftButton in its place). The artifact that appears is either ellipses "..." or the title of the previous viewController on the stack. I believe this bug to be related to the bug documented in apple's own sample code project "CustomizingUINavigationBar", CustomBackButtonViewController.m

提交回复
热议问题