2014-10-02 63 views
0

我正在开发一个应用程序。在这个应用程序中,我有一个webview。我需要在新的webview中打开webview链接,因为我需要在导航中添加一个botton。我在Stack上搜索了这个 溢出,但我没有找到任何东西。我怎样才能做到这一点?在新的导航和web视图中的Uiwebview链接

我是Xcode开发的新手。

---- -----更新

我必须使用UINavigationController的,但我需要打开webview2 webview1链接。 webview2在新的viewController中处于新的webview中。因为我需要回来。请检查this视频。

当我触摸一个应用程序,它去新的视图控制器,它有底部。我的想法是。我怎样才能做到这一点 ?

回答

0

为了实现您的目标,我认为您需要使用UINavigationController。但我仍然认为这是一个糟糕的决定。无论如何,如果您需要在控制器之间导航,请使用UINavigationController。如何做到这一点,你可以找到here,herehere

+0

请下一个答案 – user3767387 2014-10-03 15:21:21

0

如果您在导航控制器中嵌入了您的第一个webviewcontroller,然后实现了向第二个控制器的推送,您将在导航栏中看到后退按钮。当然,如果它不隐藏。

UIViewController *cont=[[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil]; 

self.navController=[[UINavigationController alloc]initWithRootViewController:cont]; 

在web视图:shouldStartLoadWithRequest:navigationType:

UIViewController *secondVC=[[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; 
secondVC.webView loadRequest:request]; 

[self.navigationController pushViewController:sec animated:YES]; 
+0

我是新来的Xcode。请简单说明一下。我不明白。对不起。 – user3767387 2014-10-03 17:07:01

+0

我在这里创建了一个小演示项目 - https://github.com/okulak/OpenLinkInNewController。你可以在那里找到它是如何工作的。只需设置你的网址。不要忘记设置特殊链接进行检查。 – Alex 2014-10-06 09:31:06

+0

什么是特殊链接?我怎么设置这个?我能收到你的电子邮件吗? – user3767387 2014-10-07 17:57:37