PhotoView+Viewpager切换下一页前一页恢复原本大小

            @Override
            public void onPageSelected(int position) {
               //获取子页面数量
                int childCount=mViewPager.getChildCount();
                for (int i=0;i

PhotoView使用:
引入依赖:

implementation 'com.github.chrisbanes:PhotoView:1.3.1'

build.gradle中加入:

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

添加布局:



设置点击事件:

          photoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {

                @Override
                public void onPhotoTap(View arg0, float arg1, float arg2) {
                 
                }

                @Override
                public void onOutsidePhotoTap() {
                }
            });

你可能感兴趣的:(PhotoView+Viewpager切换下一页前一页恢复原本大小)