Android开源项目-PhotoView

作者: Tsy远 | 来源:发表于2016-07-12 12:13 被阅读728次

PhotoView是Android的开源库,功能是支持图片的放大缩小拖动等功能

1 文档

Github地址:https://github.com/chrisbanes/PhotoView

相关文档:http://p.codekk.com/blogs/detail/54cfab086c4761e5001b253a

2 如何使用

最简单的使用方式:

布局文件:

<uk.co.senab.photoview.PhotoView
    android:id="@+id/iv_photo"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />

Activity文件:

mImageView = (PhotoView)findViewById(R.id.iv_photo);
Drawable bitmap = getResources().getDrawable(R.mipmap.ic_launcher);
mImageView.setImageDrawable(bitmap);

mAttacher = new PhotoViewAttacher(mImageView);
mAttacher.update();

3 使用心得

  1. 大小很小,对比后发现只占15k。
  2. 感觉更加适用于查看图片功能,在listview里面其实需求不是很强烈,更建议打开大图时,使用这个库可以对查看的图片进行处理。

结尾

更多文章关注我的公众号


我的公众号

相关文章

网友评论

    本文标题:Android开源项目-PhotoView

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