我有一个包含一些HTML数据的WebView的问题(我不加载URL而是HTML中的自定义内容).我用:
mWebView.loadData(mContent, "text/html; charset=utf-8", "utf-8");
Run Code Online (Sandbox Code Playgroud)
在这个HTML代码(mContent)中,我有时会有一个Twitter blockquote嵌入代码,例如:
<blockquote class="twitter-tweet"><p>"Will Remote Play on the PS Vita be available for <a style="color:#ff8600;" href="https://twitter.com/search?q=%23D3&src=hash">#D3</a> Ultimate Edition on <a style="color:#ff8600;" href="https://twitter.com/search?q=%23PS4&src=hash">#PS4</a>?" The answer is yes, and it's awesome! <a style="color:#ff8600;" href="http://t.co/Rg059nXZMF">pic.twitter.com/Rg059nXZMF</a></p> Diablo (@Diablo) <a style="color:#ff8600;" href="https://twitter.com/Diablo/statuses/400073137590530048">November 12, 2013</a></blockquote>
Run Code Online (Sandbox Code Playgroud)
所以有什么问题?好吧,我的WebView只显示没有样式或图像的推文文本.(此代码在我的iOS应用程序上完美运行.)
我在我的WebView上有setJavaScriptEnabled(true),用WebChromeClients和loadDataWithBaseURL尝试了几件事,但是我没有设法在我的WebView上很好地显示嵌入的推文.
有谁知道我该怎么做?