简体   繁体   中英

Android:Webview with link highlight

I am working with WebView on android and can't seem to figure out how to make that orange highlight that appears in the stock browser to appear on my webview.

To make it clearer let me give you an example.

When in android browser if you click on a link/image/video it'll show you a orange colored rectangle overlayed over that object. But when i try the same with my webview it does not show anything and goes onto loading that link

Oh !! i feel such an idiot... the webview does the default highlighting , the only thing was i was not giving it focus.

adding this line solved my problem

myWebView.requestFocus(View.FOCUS_DOWN);

我想补充一点,当webview变得可见时,默认情况下会突出显示webview的第一个链接 - 你可以通过调用“mWebView.clearFocus()”来摆脱它

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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