开发者

iPad/iOS: Managing multiple full screen views?

My app needs to switch between a couple of full screen views. These views are toggled by buttons in a custom overlay menu.

There are no tab bars or navigation bars visible. 开发者_如何学CThe transition between views may or may not be animated.

As I see it I can either use a single UIViewController and swap out subviews to get the desired effect or use multiple UIViewControllers and use of one Apple's containers (eg navigation controller, tabbar controller, etc), hide the navbar/tabbar and programatically switch "tabs" or push/pop controllers. The third option I suppose is to show each new view modally, but this doesn't feel right.

There is no 'order' in which the views are accessed, so my guess is the navigation controller approach won't really make sense.

Are there any major cons in either approach? Do you have any other suggestions? Will Apple reject the app if I hide the navbar or tabbar on navigation and tabbar controllers?

Thanks in advance for any advice you can offer.


I wouldn't use UINavigationController, modal windows, or a UITabBarController. The latter has some possibilities, but is too awkward in general use to be suitable.

Instead, try to use setRootViewController: on the window, as this is reasonably flexible with less overhead than the other approaches.

Choosing between multiple UIViewController subclasses or UIView swapping depends on how your app will be working in general. UIViews like to be separate, and restrict communication to your controller, but are great for more display oriented content.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜