Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I add a navigation controller to my own container view controller in iOS5?
    primarykey
    data
    text
    <p>I'm trying to create a container view controller (see screenshot) and I would like to add a navigation controller at the right, but I'm having some problems. Can you help me?</p> <p>When I add this code in my parent controller (viewDidLoad), I see the view with other position/size, I guess because I can't access navigation controller container view.</p> <p>Tried:</p> <pre><code>[self addChildViewController:_detailNavigationController]; _detailNavigationController.view.frame = CGRectMake(256, 49, 768, 651); [self.view addSubview:_detailNavigationController.view]; </code></pre> <p>And also this, but only works with the first view, evidently.</p> <pre><code>[self addChildViewController:_detailNavigationController]; _detailNavigationController.topViewController.view.frame = CGRectMake(256, 49, 768, 651); [self.view addSubview:_detailNavigationController..topViewController.view]; </code></pre> <p>Tried a hack to get navigation controller container view, but doesn't work, I see nothing on the screen and using the debugger I realized view is nil. Apart from that, likely Apple don't like this.</p> <pre><code>[self addChildViewController:_detailNavigationController]; UIView *view = [_detailNavigationController valueForKey:@"_containerView"]; view.frame = CGRectMake(256, 49, 768, 651); [self.view addSubview:view]; </code></pre> <p>Am I missing something?<br> Do you know how I can add a navigation controller inside my own customized container view controller?<br> Thanks in advance!</p> <p>Screenshot: <a href="http://img803.imageshack.us/img803/2464/screennjz.png" rel="nofollow">http://img803.imageshack.us/img803/2464/screennjz.png</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload