Webview Bild an Bildschirm anpassen in Android

Lade ich a .jpg im WebView. Mein problem ist, dass ich das gefunden: Android WebView, Skalierung Bild auf den Bildschirm passen

aber es funktioniert nicht für mich.

Hier ist mein code:

Display display = getWindowManager().getDefaultDisplay();
    int width= display.getWidth();

    Toast.makeText(getApplicationContext(), ""+width, Toast.LENGTH_LONG).show();


    String html = "<html><head><title>Example</title><meta name=\"viewport\"\"content=\"width="+width+", initial-scale=0.65 \" /></head>";
    html+= "<body><img width=\""+width+"\"<img src=\""+"image.jpg"+"\" /></body></html>";

aboutText.loadDataWithBaseURL("file:///android_res/drawable/", html, "text/html","UTF-8" , null);
InformationsquelleAutor Billabong | 2013-07-10
Schreibe einen Kommentar