1

How do I implement pinch zoom handling in a RelativeLayout and also maintain the ability to scroll while zoomed?

This is my xml file:

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/custom_list">
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/postImg" />
            <TextView
                android:layout_width="match_parent"
                android:layout_height="20dp"
                android:text="Date "                  
                android:id="@+id/postDate11" />
            <ImageView
                android:layout_width="match_parent"
                android:layout_height="12dp"
                android:src="@drawable/view" />
        </LinearLayout>   
    </ScrollView> 
</RelativeLayout>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Shivam Kumar
  • 1,892
  • 2
  • 21
  • 33
  • Welcome, @Shivam. I edited the title to be more clear and concise; formatted code snippet; clarified your opening problem statement; and removed unnecessary and redundant information. – gfullam Jun 17 '16 at 12:09
  • This question seems to have been asked and answered in a [variety of ways](http://stackoverflow.com/search?q=Android+zoom+relativelayout). Have you already looked at these other posts for help? Remember to search and research before creating your own question. See: [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) and [Why are some questions marked as duplicate?](http://stackoverflow.com/help/duplicates) – gfullam Jun 17 '16 at 12:12
  • Possible duplicate of [Android - zoom in/out RelativeLayout with spread/pinch](http://stackoverflow.com/questions/10013906/android-zoom-in-out-relativelayout-with-spread-pinch) – gfullam Jun 17 '16 at 12:13

0 Answers0