I have a webview. Everything is working fine but when I am opening a page which has iframe, the iframe is not getting visible. Are there any specific settings required?
相关问题
- Is there a limit to how many levels you can nest i
- How can I create this custom Bottom Navigation on
- How to toggle on Order in ReactJS
- Bottom Navigation View gets Shrink Down
- void before promise syntax
following hack worked for me for loading iframes in webview.Hope some one still might find it useful
Also do not forget to add Internet permission in your manifest file.
First add Hardware Acceleration and add the following lines to your webView
EDIT 1
It will be hard to identify the problem but try adding
WebChromeClient
,WebViewClient
and also don't forget to enable javascript before loadingURL
like thisEDIT 2
If you really need to load content of iframe then Try using Jsoup to load html page but you have to find the iframe and fetch the content manually.
where
iframe1
is id of youriframe
.Can you check if you have
in your AndroidManifest file, in the
<application>
tag of that activity.This maybe a too late answer! I hope it will help someone.
Just try to set up a desktop user agent to your webview
If you modify webview configurations and use loadData function to load iframe, some iframes will not work in webview. So for the solution I have implemented AdvancedWebView library.
https://github.com/delight-im/Android-AdvancedWebView
Use loadHtml(URL) method with this webview and you can pass URL in parameter and you will be able to view iframe in webview.