0
点赞
收藏
分享

微信扫一扫

PhotoView (通过各种触摸手势实现缩放图片)开源库的简单引入

引入步骤: 

1、在项目\build.gradle文件中加入如下代码:

allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}

 

2、在项目\app\build.gradle文件中加入如下代码:

dependencies {


implementation 'com.github.chrisbanes:PhotoView:2.0.0'
}

 

3、创建组件

        android:id="@+id/pv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

 

4、设置图片

PhotoView photoView = findViewById(R.id.pv);
photoView.setImageResource(R.mipmap.img);

 

 

效果图:

PhotoView (通过各种触摸手势实现缩放图片)开源库的简单引入_github


举报

相关推荐

0 条评论