开发者

UIWebView leaves behind link highlight when returning NO from "shouldStartLoadWithRequest"

开发者 https://www.devze.com 2022-12-26 01:29 出处:网络
If I return NO in the following method... - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType

If I return NO in the following method...

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType

...the grey link highlight around the link that was pressed gets left behind. Is there someway to dismiss the highli开发者_StackOverflow中文版ght? FYI, I return NO on certain links because I want to do something other than load new content in the web view.


I came across your post today. Maybe you've already solved it but I solved it this way:

a:link {
    text-decoration: none;
    color: black;
    -webkit-tap-highlight-color: #ffcc99;
}

a:visited {
    text-decoration: none;
    color: black;
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
}


I wonder if you could disable it using the following:

webView.userInteractionEnabled = NO;
webView.userInteractionEnabled = YES;


webView.userInteractionEnabled = NO;

webView.userInteractionEnabled = YES;

this can do...

0

精彩评论

暂无评论...
验证码 换一张
取 消