1, the configuration of our project in module build.gradle
dependencies {
compile 'com.github.chrisbanes:PhotoView:2.0.0'
}
In reference to the control layout xml
<uk.co.senab.photoview.PhotoView
android:id="@+id/photoview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Then introduce the second
2, the configuration of our project in module build.gradle
dependencies {
compile 'com.bm.photoview:library:1.4.1'
}
In reference to the control layout xml
<com.bm.library.PhotoView
android:id="@+id/photoview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
3. Set can be scaled, the default does not support zoom ...
photoView.disenable();
use
PhotoView photoZhi = findViewById(R.id.photoview);
photoZhi.setImageResource(R.mipmap.zhi);
photoZhi.enable();
photoZhi.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});