이 있었다 : 대신에, 그래서
width="100%"
무엇인지 내가 한 : 내가 읽어 보시기 바랍니다 당신은 필드 내부에 HTML이나 XML이를 추가해야 화면 폭에 맞게하기 위해 스케일링 및 이미지 확대/축소, 나는 XML 가져, StringBuilder 넣고 src = "https://blablabla.com/image.
public void setWebViewWithImageFit(String content){
// content is the content of the HTML or XML.
String stringToAdd = "width=\"100%\" ";
// Create a StringBuilder to insert string in the middle of content.
StringBuilder sb = new StringBuilder(content);
int i = 0;
int cont = 0;
// Check for the "src" substring, if it exists, take the index where
// it appears and insert the stringToAdd there, then increment a counter
// because the string gets altered and you should sum the length of the inserted substring
while(i != -1){
i = content.indexOf("src", i + 1);
if(i != -1) sb.insert(i + (cont * stringToAdd.length()), stringToAdd);
++cont;
}
// Set the webView with the StringBuilder: sb.toString()
WebView detailWebView = (WebView) findViewById(R.id.web_view);
detailWebView.loadDataWithBaseURL(null, sb.toString(), "text/html", "utf-8", null);
}
희망이 : 폭 = "100 %", "다음 y는 모두 StringBuilder 내 웹보기를 설정 SRC"나는 삽입 문자열 ""현장 내부와 바로 앞에있는 "PNG, 미시간 코드는 이것이다 이 문제를 해결하는 방법을 알아 내는데 몇 시간이 걸렸습니다.
아직 문제가 해결 되었습니까? – JochenJung
미안하지만 아직 해결하지 못했습니다. 여기에 해결책이 있습니다 : http://developer.android.com/guide/webapps/targeting.html 그들이 HTML 코드에 "width = device-width"태그를 추가했으나 작동하지 않는다고 말했기 때문에 : (여전히 솔루션을 찾고 있습니다. – Trox
나를 막으십시오. 지금까지 이것을 풀어 보셨습니까? – Yeung