views:

122

answers:

0

Hi, I want to show a popover with a custom contentsize. I can do it doing like so

UINavigationController* popoverContent = [[UINavigationController alloc] init];


    UIView* popoverView = [[UIView alloc]  initWithFrame:CGRectMake(0, 0, 800, 800)];

    popoverView.backgroundColor = [UIColor blueColor];

    popoverContent.view = popoverView;

    popoverContent.contentSizeForViewInPopover = CGSizeMake(55, 55);
    UIPopoverController *pop = [[UIPopoverController alloc] initWithContentViewController:popoverContent];
    [pop presentPopoverFromRect:CGRectMake(80.0, 210.0, 160.0, 40.0) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];

but if I change the content to :

popoverContent.viewControllers = [NSArray arrayWithObject:myViewController];

the

popoverContent.contentSizeForViewInPopover = CGSizeMake(55, 55);

the size doesn't change at all.

How can I change the content size while using the navigation controller? Thanks