效果图
01.png
02.png
功能
配置
1. 在项目 build.gradle 添加
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io"}
jcenter()
}
}
2. 在app 下build.gradle 添加
// PhotoView
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
简单使用
- 布局文件
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/photo_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
- 代码逻辑
public class ZoomActivity extends BaseActivity {
@BindView(R.id.photo_view)
PhotoView mPhotoView;
@Override
public int getLayoutId() {
return R.layout.activity_zoom;
}
@Override
public void initView() {
mPhotoView.setImageResource(R.mipmap.meizi);
}
}
网友评论