开发者

UINavigationController inside UIView

I can adda UINavigationController to a UIView programmatically but how is this represented in IB?

Everytime I add UINavigationController to the view heirarchy it stays at the same level as the (root) UIView. Is this normal?

I expected to be able to "drag" the UINavigationController underneath the View.

View
   - UINavigationController
   - UIView

but instead I get in IB:

View
  -UIView
UINavigationController

I basically have, in my app, a View that contains two sections, the top section is a UIView and the bottom section is the UINaivationController. (think of it as something like a开发者_运维技巧 split view but vertically)

my main question is this: Is it normal to see the UINaigationController at the same level as the root view in IB during design the views?


Pretty much. IB doesn't really let you do much with controller-owned views; you'll need an outlet pointing to that navigation controller, then, in -viewDidLoad or -application:didFinishLaunchingWithOptions: or whatever, add the navigation controller's view to whatever view you want as its parent, i.e.

[self.theParentViewOutlet addSubview:self.theNavigationControllerOutlet.view];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜