gpt4 book ai didi

android - 在 webview 中看不到 HTML 字符串

转载 作者:搜寻专家 更新时间:2023-11-01 09:48:48 30 4
gpt4 key购买 nike

我的 html 字符串是 =

<html><head></head><body><div style='display: inline-flex; background-color: rgb(105, 105, 105); width: 180px; text-align: center;'><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> e </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> q </div><div style= 'text-align: center; height: 35px; font-family: Tahoma; font-size: 1.6em; color: rgb(161, 119, 255);'> h </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> o </div><div style= 'transform: rotate(-16deg); color: red; font-weight: 400; height: 35px; text-align: center; font-size: 3em;'> O </div><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> b </div></div></body></html>

此 Html 字符串未在 Web View 中加载。如果有人有任何解决方案,请分享...

我的代码是:

String url_captcha="<html><head></head><body><div style='display: inline-flex; background-color: rgb(105, 105, 105); width: 180px; text-align: center;'><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> e </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> q </div><div style= 'text-align: center; height: 35px; font-family: Tahoma; font-size: 1.6em; color: rgb(161, 119, 255);'> h </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> o </div><div style= 'transform: rotate(-16deg); color: red; font-weight: 400; height: 35px; text-align: center; font-size: 3em;'> O </div><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> b </div></div></body></html>";
String Url = url_captcha.replace("'", "\"");
Url = Url.replace("\\", "\\\\");

captchaAnimation();
web_Captcha.getSettings().setJavaScriptEnabled(true);
web_Captcha.loadData(Url, "html/text", "utf-8");

最佳答案

String url_captcha="<html><head></head><body><div style='display: inline-flex; background-color: rgb(105, 105, 105); width: 180px; text-align: center;'><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> e </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> q </div><div style= 'text-align: center; height: 35px; font-family: Tahoma; font-size: 1.6em; color: rgb(161, 119, 255);'> h </div><div style= 'transform: rotate(-6deg); font-weight: 400; text-align: center; color: tan; height: auto; font-family: Georgia; font-size: 3em;'> o </div><div style= 'transform: rotate(-16deg); color: red; font-weight: 400; height: 35px; text-align: center; font-size: 3em;'> O </div><div style= 'transform: rotate(11deg); font-weight: 400; height: 35px; text-align: center; font-size: 2em; font-family: caption; color: tomato; text-shadow: 1px 1px turquoise;'> b </div></div></body></html>";    
wv.getSettings().setJavaScriptEnabled(true);
wv.loadDataWithBaseURL(null, url_captcha, "text/html", "utf-8", null);

关于android - 在 webview 中看不到 HTML 字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36740132/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com