美文网首页
Android一行代码 搞定图片太多,太大OOM(内存溢出)

Android一行代码 搞定图片太多,太大OOM(内存溢出)

作者: 超级Luke | 来源:发表于2017-08-31 11:50 被阅读0次

AndroidUIImageView

重写ImageView,防止内存溢出(oom),图片不压缩。Android新手看这里~~

如何导入?

  • Android Studio

      allprojects {
          repositories {
            ...
            maven { url 'https://jitpack.io' }
          }
      }
        
      dependencies {
          compile 'com.github.shuhaoSCode:AndroidUIImageView:-SNAPSHOT'
      }
    
  • eclipse。。。请自行copy class。

如何使用?

<com.shuhao.uiimageview.UIImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@mipmap/ic_launcher"/>

简单粗暴有木有,直接做ImageView就行。原来OOM的项目现在完美运行~

(跪求star_(:з」∠)_) 进入github查看最新版本

相关文章

网友评论

      本文标题:Android一行代码 搞定图片太多,太大OOM(内存溢出)

      本文链接:https://www.haomeiwen.com/subject/ooqqjxtx.html