- (void)presentLoginWebView
{
UIViewController *webViewController = [[UIViewController alloc] init];
webViewController.title = NSLocalizedString(@"IB_LOG_IN_TITLE", nil);
UIWebView *webView = [[UIWebView alloc] initWithFrame:webViewController.view.frame];
webViewController.view = webView;
[self.navigationController pushViewController:webViewController animated:NO];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:IB_GET_OAUTH_TOKEN_URL]]];
webView.scalesPageToFit = YES;
webView.delegate = self; //delegate methods below
if (deviceVersion > 6)
{
[self.navigationController.interactivePopGestureRecognizer setEnabled:NO];
}
[self.navigationController.navigationItem setHidesBackButton:YES];
//The following line doesn't work either
//self.presentedViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIView alloc] init]];
}
答案 0 :(得分:2)
以下代码可以使用。只试用navigationItem
,而不是navigationController.navigationItem
webViewController.navigationItem.hidesBackButton = YES;
答案 1 :(得分:1)
尝试隐藏webViewController
webViewController.navigationItem.hidesBackButton = YES;