简体   繁体   English

从uiwebview链接到其他选项卡栏视图

[英]Links to other tab bar view from uiwebview

I have a tab bar iphone app. 我有一个标签栏iPhone应用程序。 The second tab has formatted text with images so I inserted it as html file to uiwebview. 第二个选项卡已格式化带有图像的文本,因此我将其作为html文件插入到uiwebview中。 I would like insert links on some parts of the text and on some images in this html file to the first tab view with different parameters. 我想在此HTML文件中的文本的某些部分和某些图像上的链接插入具有不同参数的第一个选项卡视图。 How can I do that? 我怎样才能做到这一点?

Create an instance of UIWebViewDelegate,and implement the method: 创建UIWebViewDelegate的实例,并实现该方法:

"webView:shouldStartLoadWithRequest:navigationType:

Sent before a web view begins loading content."

...and implement your code to do things on the first tab when the user clicks any of the "special" links. ...并实现您的代码,以在用户单击任何“特殊”链接时在第一个选项卡上执行操作。 Also, make sure to return "false" when the link clicked is one of those links, to stop the webview from loading them in the second tab. 另外,请确保当单击的链接是这些链接之一时返回“ false”,以阻止webview在第二个选项卡中加载它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM