2016-04-20 14 views
2

String meiner html gesehen ist =HTML-String nicht in webview

<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> 

Dieser HTML-String ist nicht in webview laden. Wenn jemand eine Lösung haben, bitte teilen ...

mein Code:

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"); 

Antwort

2
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); 
+0

Dank @Nirav seine Arbeits – BarmanInfo

Verwandte Themen