开发者

iOS: How to properly use Navigation Controller without any visible user interface

开发者 https://www.devze.com 2023-03-18 00:05 出处:网络
I have an application that seems best suited for a navigation controller.There are a few places where navigation splits off and is not completely hierarchical but I think I can remedythat just using a

I have an application that seems best suited for a navigation controller. There are a few places where navigation splits off and is not completely hierarchical but I think I can remedy that just using a modal view at those points.

I wan开发者_Python百科t to know if this is the best way to navigate through multiple views or if there is a better way. I want the user to be able to progress through several steps but be able to go back a step or even return to the beginning at certain points.

Additionally, I want to be able to do this using custom buttons. I want to use the entire screen without any navigation bars, etc. I figured I could push and pop the stack with my own custom buttons but I want to know how to make sure the screen is totally usable by me.


As far as I know, Navigation controller is the best way to navigate among views, you can go back and forth between views using navigation controller easily, even you can present navigation controller as modal view. You can specify your own custom navigation items in navigation bar. And if you do not want navigation bar, you can hide navigation bar. pushing and popping is the best way to implement navigation among views.


@gonzobrains

I have been in that situation!

Here's what I'd do:

"Hide the navigation bar" using the setHidden property. At places where you want the navigation bar to be seen, I suggest you use a UIToolbar with custom buttons. (its almost impossible to differentiate)

to go back one step you can popViewController

to go all the way back you can use popToRootViewController (like the top right corner button in the IMDB app)

There is no reason why you should not be able to use a navigation controller without using the navigation bar.

Hope this helps!


Keep the nav controller, but you can hide the nav bar easily enough. It could be a viable solution, but make sure your implementation is solid and clear; otherwise you may be rejected. A possible alternative would be to have pages side by side, as in the weather app…but it's your decision as to which paradigm is best.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号