A home button in iOS 5, xcode 4.2, Story board

徘徊边缘 提交于 2019-12-31 05:20:28

问题


iOS 5.0, xCode 4.2

I am doing a multistep questionnaire.

There are about 10 questions on each branch, and there are sub branches. But the logic is fairly linear. Mostly Yes/no answers, but some multi choice options. The questionnaire will come to a conclusion page.

On this conclusion page, I would like to have a button that says HOME which takes the user to a specific start page so they can start again.

The problem is that I want the navigation controller stack to be cleared so the back buttons will not loop through the past selections.

Put another way, I want to clear out all of the view controllers on the navigation stack. Is there a simple way to do this?


回答1:


popToRootViewControllerAnimated: on UINavigationController will clear out the stack and return you to the root controller.




回答2:


You can set the viewControllers property of UINavigationController. This can even be done animated.



来源:https://stackoverflow.com/questions/9946701/a-home-button-in-ios-5-xcode-4-2-story-board

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