Clicking a link in UIWebView pushes onto the NavigationView stack

后端 未结 1 1422
予麋鹿
予麋鹿 2020-12-05 21:56

Basically, I\'d like to know how to intercept a click in a webview and then have a new view pop up that has a navigation bar at the top (with a back button) and the content

相关标签:
1条回答
  • 2020-12-05 22:26

    This question has been asked many times before. Please have a look at this page, it's almost exactly what you need, just change the [BrowserViewController openBrowserWithUrl:url]; to whatever you need to push your new ViewController to the navigation stack. It might look like that:

    LatestView *latestView = [[LatestView alloc] initWithNibName:@"LatestView" bundle:nil]; 
    
    //Pass the URL here, depends on how you passed it into the WebView in the first place   
    
    // Add the ViewController to the stack
    [self.navigationController pushViewController:latestView animated:YES]; 
    [latestView release];   
    
    0 讨论(0)
提交回复
热议问题