开发者

Do I need a UINavigationController?

开发者 https://www.devze.com 2023-03-01 15:43 出处:网络
I\'m building my very first iPhone application. It\'s pretty simple, I\'m displaying two lists the user can switch between using a tabbar.

I'm building my very first iPhone application. It's pretty simple, I'm displaying two lists the user can switch between using a tabbar.

I'm unfamiliar with the IB, so I'm building the UI from scratch, hoping to learn a thing or two about the inner workings that would otherwise be hidden.

开发者_开发百科My question for SO is: Do I need a UINavigationController? There are no levels of navigation to this (yet), so the navigation stack described here seems excessive.

What's SO's advice?


Short answer: You don't need a UINavigationController.

Longer less definitive answer: Since you are just starting out I wouldn't mess with the UINavigationController just yet. Get comfortable with the UITabController and the two view controllers you need to show on each tab.

At some point, though, you may want to consider experimenting with the UINavigationController as you may find you want something to happen when a user taps on a list item within one of those lists. Perhaps you'll want to show more detail at that point, show a map, or a form, etc. That's when the UINavigationController is going to come in handy.


Well......... no you dont need one. But yes, I would take the time to use one. The UINavigationController and the UITableViewController are the two most used controllers in the iphone SDK. Better get to know them if you want to be an IOS programmer.

Also.. you said that you dont need "levels of navigation... yet". Better do it right from the beginning or you will be redoing all your code later on.

just my two pesos.


If you have two completely separate views, a UITabBar would be the far better pick.

This just shows a "ribbon" of sorts at the bottom of the screen which allows for choosing an option. The UITabBar is generally used for switching completely unrelated views, such as your use case.

On the other hand, a UINavigationController is used to form a tree-like hierarchy or drilldown and is ill suited for your use case.

0

精彩评论

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

关注公众号