iPhone Pushing View Controller in a left direction

前端 未结 6 1588
耶瑟儿~
耶瑟儿~ 2020-12-05 12:07

I have an app that has a centre view with two views off to each side of it. I want to have two navigation bar buttons, left and right which push a new navigation controller

6条回答
  •  一整个雨季
    2020-12-05 12:51

    I don't think you can explicitly define sliding direction in UINavigationControllers. What you might be able to do is pop the current view off the navigation stack to show the prior view, which would animate in the manner you want. However this may be complex if you want to have different view controllers appear depending on what you do on the current view.

    If your workflow is not too complicated, you can hold a reference to the prior view controller in the current view controller. depending on what you do on the current view (like select a table view cell), you can change whatever data you need in the prior view controller, and then call

    [self.navigationController popViewController];
    

    or whatever the correct method is (i think that's pretty close to how it is). that would let you move down the nav stack with the animation you want, which works if your nav stack has a set number of views on it.

提交回复
热议问题