Prevent the animation when clicking “Back” button in a navigation bar?

后端 未结 5 1349
自闭症患者
自闭症患者 2020-12-14 09:16

My application has a navigation controller and I don\'t want any animation in it :

  • to prevent an animation when pushing a view, it\'s easy, via the pushView

5条回答
  •  轮回少年
    2020-12-14 09:41

    I just answered another related question that describes how to easily create a custom back button that replicates the look of the standard iOS (iPhone / iPad) UI back bar button item but allows other functions to be added. As recommended in falconcreek's answer, in the backButtonPressed method, just add:

    [[self navigationController] popViewControllerAnimated:NO];
    

提交回复
热议问题