0

我正在尝试显示模态视图控制器,但保持导航栏显示在 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];
}
4

1 回答 1

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];

}

于 2012-06-05T17:15:04.487 回答