我在所有 ViewControllers 中使用此代码来创建后退按钮:
self.btnBack = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 44)];
[self.btnBack setBackgroundImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
[self.btnBack addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchUpInside];
-(void)cancel:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
但是,当我使用控制器进入控制器时,UIWebView
我需要点击 2 次才能返回 ios 6。而在 ios 7 中,当我点击 1 次时UIWebView
,我的导航消失时会显示黑屏,并且在第二次点击时应用程序崩溃。
在所有屏幕中,这很有效,也许有一些特别的东西UIWebView
,我不知道。请帮忙!
我推 webview:
-(IBAction)doPrivacy:(id)sender
{
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
WebPageViewController *web = (WebPageViewController*)[storyBoard instantiateViewControllerWithIdentifier:@"WebPage"];
web.hidesBottomBarWhenPushed = YES;
web.urlToOpen = @"http://dfdfdf.co";
[self.navigationController pushViewController:web animated:YES];
}