Android Pinch Zoom ImageView(PhotoView)与ScrollView

4
我有一个在Android中的布局,其中我基本上有一个图像视图,它具有复合标题,由其他imageviews + textviews组成:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">

    <RelativeLayout
            android:id="@+id/imagePager_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

        <uk.co.senab.photoview.PhotoView
                android:id="@+id/imagePager_imageView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

        <TextView
                android:id="@+id/imagePager_textTitle"
                android:layout_width="fill_parent"
                android:gravity="center"
                android:textStyle="bold"
                android:text="TITLE"
                android:layout_margin="0dp"
                android:layout_below="@+id/imagePager_imageView"
                android:layout_height="wrap_content"/>

        <ImageView android:id="@+id/imagePager_titleLine"
                   android:layout_width="fill_parent"
                   android:layout_below="@+id/imagePager_textTitle"
                   android:layout_height="match_parent"
                   android:paddingLeft="5dp"
                   android:paddingRight="5dp"
                   android:src="@drawable/linebig"/>

        <TextView
                android:id="@+id/imagePager_textSubtitle"
                android:layout_width="fill_parent"
                android:gravity="center"
                android:text="SUBTITLE"
                android:layout_margin="0dp"
                android:layout_below="@+id/imagePager_titleLine"
                android:layout_height="wrap_content"/>

        <ImageView android:id="@+id/imagePager_subtitleLine"
                   android:layout_below="@+id/imagePager_textSubtitle"
                   android:layout_width="fill_parent"
                   android:layout_height="match_parent"
                   android:paddingLeft="30dp"
                   android:paddingRight="30dp"
                   android:paddingBottom="10dp"
                   android:src="@drawable/linebig"/>

        <TextView
                android:id="@+id/imagePager_textContent"
                android:layout_width="fill_parent"
                android:paddingTop="15dp"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:text="CONTENT"
                android:layout_margin="0dp"
                android:layout_below="@+id/imagePager_subtitleLine"
                android:layout_height="wrap_content"/>


    </RelativeLayout>
</ScrollView>

问题在于,如果整个内容太“长”,使得ScrollView被启用,则Pinch Zoom无法正常工作。否则可以正常工作。我认为ScrollView的监听器会将“捏”和上下滑动视为一起。有人解决这个问题了吗?
1个回答

0

将您的ScrollView更改为android.support.v4.widget.NestedScrollView


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接