Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 通过单击TabBarItem重新加载视图(导致PDF)_Iphone_Objective C_Pdf_Uiwebview_Uitabbaritem - Fatal编程技术网

Iphone 通过单击TabBarItem重新加载视图(导致PDF)

Iphone 通过单击TabBarItem重新加载视图(导致PDF),iphone,objective-c,pdf,uiwebview,uitabbaritem,Iphone,Objective C,Pdf,Uiwebview,Uitabbaritem,我有一个带有4项的选项卡栏控制器。在第4页中,我包含了一个带有一些链接的webView。其中一个链接是PDF,如果我在webView中打开PDF,则无法返回带有链接的主webView。 有没有办法重新点击4。选项卡栏重新加载视图?如果我从3号换。到4号。选项卡栏它工作(视图将出现)![在此处输入图像描述][1] 提前感谢您的帮助。UITabBarDelegate中有一个方法称为: - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarI

我有一个带有4项的选项卡栏控制器。在第4页中,我包含了一个带有一些链接的webView。其中一个链接是PDF,如果我在webView中打开PDF,则无法返回带有链接的主webView。 有没有办法重新点击4。选项卡栏重新加载视图?如果我从3号换。到4号。选项卡栏它工作(视图将出现)![在此处输入图像描述][1]


提前感谢您的帮助。

UITabBarDelegate中有一个方法称为:

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item; 
您还可以使用它来捕捉所选选项卡栏项目的触摸。

尝试使用()的方法:

(可能是这样的)

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
        //Try this if you're pushing the webView in another ViewController
        [viewController.navigationController popToRootViewControllerAnimated:YES];
        //or access to your webView and call goBack();
}