开发者

Android: WebView unable to show '%' percentage sign

开发者 https://www.devze.com 2023-02-12 20:02 出处:网络
开发者_如何学GoI try to play an html and js code in webview. the code contains the sign \'%\' and the webview return an error ERROR_BAD_URL.
开发者_如何学Go

I try to play an html and js code in webview. the code contains the sign '%' and the webview return an error ERROR_BAD_URL.

<style type='text/css'>
test{
width: 100%;
height: 100%;
}
</style>

any idea?

-Z


use webview.loadDataWithBaseUrl if .loadData causes problems.


I ran into this myself this weekend. Use "%25" to make the % symbol. Your new code should look like ...

<style type='text/css'>
    test{
        width: 100%25;
        height: 100%25;
    }
</style>


try this

mWebView.loadDataWithBaseURL(null, html,"text/html", "UTF-8", null); 
0

精彩评论

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

关注公众号