Android PhotoView 使用教程

github:
https://github.com/anymyna/ui

https://github.com/chrisbanes/PhotoView
Implementation of ImageView for Android that supports zooming, by various touch gestures.

效果:
Android PhotoView 使用教程_第1张图片

步骤:
1、 初始化

allprojects {
	repositories {
        maven { url "https://jitpack.io" }
    }
}
dependencies {
    implementation 'com.github.chrisbanes:PhotoView:1.2.6'
}

2、 用法

<com.github.chrisbanes.photoview.PhotoView
    android:id="@+id/photo_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
PhotoView photoView = (PhotoView) findViewById(R.id.photo_view);
photoView.setImageResource(R.drawable.image);

你可能感兴趣的:(Android)