解决Android4.4 webview 图片如何自适应 之前的方法失效问题

上传者: kimyo8337373 | 上传时间: 2015-02-08 00:00:00 | 文件大小: 1.81MB | 文件类型: rar
Android4.4之后 webview内核换了 无法自适应大小了 一般的想法就是写js 再调用,这个办法可行,但是却是相当的麻烦。 而动态的改变内容的宽,把html 图片的宽设置成 100% ,也可以做到图片适应屏幕的要求,而且操作性相对简单不少。但是要注意一个要求是:高度要设置成 auto, 否则会导致图片变形。

文件下载

资源详情

[{"title":"( 53 个子文件 1.81MB ) 解决Android4.4 webview 图片如何自适应 之前的方法失效问题","children":[{"title":"Android44WebView","children":[{"title":".project <span style='color:#111;'> 852B </span>","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'> 563B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"com","children":[{"title":"example","children":[{"title":"android44webview","children":[{"title":"HttpUtils.java <span style='color:#111;'> 4.48KB </span>","children":null,"spread":false},{"title":"MainActivity.java <span style='color:#111;'> 3.90KB </span>","children":null,"spread":false},{"title":"Const.java <span style='color:#111;'> 590B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"AndroidManifest.xml <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"drawable-ldpi","children":null,"spread":false},{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 7.48KB </span>","children":null,"spread":false}],"spread":true},{"title":"values-v11","children":[{"title":"styles.xml <span style='color:#111;'> 334B </span>","children":null,"spread":false}],"spread":true},{"title":"menu","children":[{"title":"main.xml <span style='color:#111;'> 263B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.69KB </span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"activity_main.xml <span style='color:#111;'> 543B </span>","children":null,"spread":false}],"spread":true},{"title":"values-sw600dp","children":[{"title":"dimens.xml <span style='color:#111;'> 203B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 24.20KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 12.22KB </span>","children":null,"spread":false}],"spread":false},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 233B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 697B </span>","children":null,"spread":false},{"title":"dimens.xml <span style='color:#111;'> 220B </span>","children":null,"spread":false}],"spread":false},{"title":"values-sw720dp-land","children":[{"title":"dimens.xml <span style='color:#111;'> 277B </span>","children":null,"spread":false}],"spread":false},{"title":"values-v14","children":[{"title":"styles.xml <span style='color:#111;'> 391B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":".settings","children":[{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 177B </span>","children":null,"spread":false},{"title":"org.eclipse.core.resources.prefs <span style='color:#111;'> 99B </span>","children":null,"spread":false}],"spread":true},{"title":"assets","children":null,"spread":false},{"title":"gen","children":[{"title":"com","children":[{"title":"example","children":[{"title":"android44webview","children":[{"title":"BuildConfig.java <span style='color:#111;'> 170B </span>","children":null,"spread":false},{"title":"R.java <span style='color:#111;'> 2.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"libs","children":[{"title":"android-support-v4.jar <span style='color:#111;'> 543.16KB </span>","children":null,"spread":false},{"title":"jsoup-1.8.1.jar <span style='color:#111;'> 293.79KB </span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'> 459B </span>","children":null,"spread":false},{"title":"proguard-project.txt <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"ic_launcher-web.png <span style='color:#111;'> 50.19KB </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"resources.ap_ <span style='color:#111;'> 39.94KB </span>","children":null,"spread":false},{"title":"classes","children":[{"title":"com","children":[{"title":"example","children":[{"title":"android44webview","children":[{"title":"HttpUtils.class <span style='color:#111;'> 4.67KB </span>","children":null,"spread":false},{"title":"R$layout.class <span style='color:#111;'> 433B </span>","children":null,"spread":false},{"title":"R$style.class <span style='color:#111;'> 461B </span>","children":null,"spread":false},{"title":"R$dimen.class <span style='color:#111;'> 491B </span>","children":null,"spread":false},{"title":"BuildConfig.class <span style='color:#111;'> 365B </span>","children":null,"spread":false},{"title":"R$drawable.class <span style='color:#111;'> 437B </span>","children":null,"spread":false},{"title":"R$attr.class <span style='color:#111;'> 370B </span>","children":null,"spread":false},{"title":"Const.class <span style='color:#111;'> 1.02KB </span>","children":null,"spread":false},{"title":"R$id.class <span style='color:#111;'> 462B </span>","children":null,"spread":false},{"title":"R.class <span style='color:#111;'> 773B </span>","children":null,"spread":false},{"title":"R$string.class <span style='color:#111;'> 502B </span>","children":null,"spread":false},{"title":"R$menu.class <span style='color:#111;'> 418B </span>","children":null,"spread":false},{"title":"MainActivity.class <span style='color:#111;'> 2.67KB </span>","children":null,"spread":false},{"title":"MainActivity$ContentTask.class <span style='color:#111;'> 4.61KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"dexedLibs","children":[{"title":"android-support-v4-bf0312901c397fea2d357393219f95e1.jar <span style='color:#111;'> 206.37KB </span>","children":null,"spread":false},{"title":"jsoup-1.8.1-0865523e39c8a0a0680d8cfc20531221.jar <span style='color:#111;'> 107.69KB </span>","children":null,"spread":false}],"spread":false},{"title":"jarlist.cache <span style='color:#111;'> 120B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 5.82KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.04KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 17.47KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 9.14KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"Android44WebView.apk <span style='color:#111;'> 354.83KB </span>","children":null,"spread":false},{"title":"classes.dex <span style='color:#111;'> 987.23KB </span>","children":null,"spread":false}],"spread":true}],"spread":false}],"spread":true}]

评论信息

  • M_ENG_ING :
    项目中遇到同样的问题,正好下载试试看!!!
    2018-12-10
  • jason牵着蜗牛去散步 :
    项目中遇到同样的问题,正好下载试试看
    2018-06-11
  • zxfnicholas :
    有一些架包可以用!
    2017-07-24
  • sun8454849 :
    我用了下 里面某一块 非常适合我的项目
    2016-06-28
  • u010096890 :
    不错,赞一个
    2016-06-01

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明