我现在有点绝望:/我有一个带有 4 个项目的标签栏控制器。在 4. 选项卡中,我包含了一个显示 pdf 列表的 webView。如果我在 webView 中打开 PDF,则无法通过链接返回主 webView。有没有办法通过重新点击 4. TabBar 来重新加载 View?如果我从 3. 更改为 4. tabbar 它可以工作(viewWillAppear)。
有人告诉我,以下方法应该有效:
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
if ([viewController isKindOfClass:[UIColor class]]) {
//Try this if you're pushing the webView in another ViewController
[viewController.navigationController popToRootViewControllerAnimated:YES];
//or access to your webView and call goBack();
}
}
但实际上我不知道应该在哪个文件中插入该方法。(见打印屏幕)
非常感谢你们的帮助!