[英]Reload View by Clicking on TabBarItem (Cause of PDF)
我有一個帶有4個項目的標簽欄控制器。 在第4章中,我包含了一個帶有某些鏈接的webView。 鏈接之一是PDF,如果我在webView中打開PDF,則無法通過鏈接返回主webView。 是否可以通過重新單擊4. TabBar重新加載視圖? 如果我從3.選項卡欄更改為4.,它會起作用(viewWillAppear)。 ![在此處輸入圖片描述] [1]
在此先感謝您的幫助。
UITabBarDelegate中有一個方法稱為:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item;
您也可以使用它來捕捉所選標簽欄項目的內容。
嘗試使用( UITabBarControllerDelegate )的此方法:
(也許像這樣)
- (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();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.