模态视图控制器大小

时间:2012-06-05 17:03:08

标签: objective-c ipad uiviewcontroller modal-dialog modalviewcontroller

我正在尝试显示模态视图控制器,但保持导航栏显示在iPad上。我尝试了不同的演示风格但没有工作。是可以调整大小,还是在某个视图的顶部显示它,而不是在整个视图控制器上方?

编辑: 已添加代码:

- (void)buttonPressed:(id)sender
{
    RKWebViewController *webViewController = [[RKWebViewController alloc] initWithNibName:nil bundle:nil];
    webViewController.request = [NSURLRequest requestWithURL:_link];
    webViewController.webView.delegate = self;
    webViewController.shouldDisplayDoneButton = YES;
    webViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
    [self presentModalViewController:webViewController animated:YES];
}

1 个答案:

答案 0 :(得分:2)

使用 -

- (void)buttonPressed:(id)sender
{
    RKWebViewController *webViewController = [[RKWebViewController alloc] initWithNibName:nil bundle:nil];
    webViewController.request = [NSURLRequest requestWithURL:_link];
    webViewController.webView.delegate = self;
    webViewController.shouldDisplayDoneButton = YES;

    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:webViewController];
    [webViewController release];

    navController.modalPresentationStyle = UIModalPresentationCurrentContext;
    [self presentModalViewController:navController animated:YES];
    [navController release];

}