放大图 带回弹效果

♀尐吖头ヾ 提交于 2020-01-10 14:34:34

 

 

布局就是一个imagview

加依赖

implementation 'com.github.chrisbanes.photoview:library:1.2.4'implementation 'com.android.support:support-v4:27.1.1'调三方控件 photoview参考地址:https://blog.csdn.net/dpl12/article/details/78160993

 

 

imageView = findViewById(R.id.imageView2);
        Intent intent = getIntent();
        String content = intent.getStringExtra("photo");

        Glide.with(this).load(content).into(imageView);
        imageView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
            @Override
            public void onPhotoTap(View view, float x, float y) {
                ActivityCompat.finishAfterTransition(OtherActivity.this);
            }
        });

  

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!