【发布时间】:2021-01-20 07:50:21
【问题描述】:
我正在尝试在单击时为图像添加全屏图像查看器功能,它应该包括放大/缩小和左右滑动。 我使用 TouchImageView 和 ViewPager 成功添加了该功能,但是在缩放或幻灯片图像上正在重新绘制和堆叠(附加图像)。
我在没有 viewpager 的情况下尝试过,即使使用 photoview 之类的库,问题仍然存在。 请帮忙!任何帮助都将不胜感激。
代码 布局.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/imgDisplay"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
fullscreeActivity的oncreate方法,当用户点击GalleryActivity上的图片时该Activity启动
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fullscreen);
ButterKnife.bind(this);
/*viewPager = (ViewPager) findViewById(R.id.pager);*/
Intent i = getIntent();
int position = i.getIntExtra("position", 0);
ArrayList<String> imageUrls = new ArrayList<String>(3);
imgDisplay.setImageResource(R.drawable.amv6);
问题依然存在。
【问题讨论】:
-
发布你迄今为止尝试过的代码。
-
@UsamaAltaf 寻求帮助,使用您的代码后,问题仍然存在。
标签: java android android-glide photoview