OGeek|极客世界-中国程序员成长平台

标题: html - 单击href链接时如何从uiwebview中删除href灰色选择和闪烁效果? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 02:28
标题: html - 单击href链接时如何从uiwebview中删除href灰色选择和闪烁效果?

我在 UIWebView 中加载了一些 html 代码,同时单击 href 一些灰色选择显示会产生一种闪烁效果。如何去除效果?

使用 anchor 标记(包含按钮和文本)仅用于观察点击事件以触发某些功能。是否可以使用任何其他容器来获取点击事件?

下面是html代码,

NSString *displayHtmlStr = [NSString stringWithFormat"< html>< a href='yourTag01' style=text-decoration:none; color:black;> < button style='width:30px;height:30px;border-radius:100px;'>A< /button>The production stages of the silk and the sales values at each stage< /a> < /html>"];
[mywebView loadHTMLString:displayHtmlStr baseURL:nil];

这是我捕获点击事件的方式,

-(BOOL)webViewUIWebView *)webView shouldStartLoadWithRequestNSURLRequest *)request navigationTypeUIWebViewNavigationType)navigationType
{
if(navigationType== UIWebViewNavigationTypeLinkClicked && request.URL lastPathComponent] isEqualToString"tag0"])
    {        
NSLog(@"clicked A");   
//Some functionality
 }
}

提前致谢



Best Answer-推荐答案


在样式中添加

-webkit-tap-highlight-color: rgba(0,0,0,0);

关于html - 单击href链接时如何从uiwebview中删除href灰色选择和闪烁效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26233143/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4