2

I have an android application in which I am using ImageView to show images. I also set scrollview in imageview. there is also zoom functionality in imageview. when in zoom in image then scrollview not allow to show full image after zoom in. It shows only that part of image which is inside the scrollbar. I want to show full iamge using scrollbar after zoom in.here is the code of my XML file.

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/org_back"
    android:orientation="vertical" >


    <RelativeLayout
    android:id="@+id/rlayout1"
    android:layout_width="match_parent"
    android:layout_height="400dp"
    android:layout_marginBottom="10dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="10dp"
    android:background="@drawable/layout_shape" >

        <ScrollView 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="10dip"
         android:scrollbarStyle="outsideOverlay"
         android:fadeScrollbars="true"
         android:scrollbarSize="10dip">
        <HorizontalScrollView
        android:layout_width="match_parent"          
        android:layout_height="wrap_content" >
             <ImageView
             android:id="@+id/imageView"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             android:scaleType="matrix"
             android:adjustViewBounds="true"
             android:layout_gravity="center_horizontal"
             android:addStatesFromChildren="true">
            </ImageView> 

       </HorizontalScrollView>
       </ScrollView> 

       </RelativeLayout>


        <Button
        android:id="@+id/btnprev"
        android:layout_alignBaseline="@+id/btnbackHome"
        android:layout_width="80dp"
        android:layout_height="40dp"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="20dp"
        android:background="@drawable/button"
        android:text="Previous" />

        <Button
        android:id="@+id/btnbackHome"
        android:layout_width="80dp"
        android:layout_height="40dp"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:background="@drawable/button"
        android:text="Home" />

        <Button
        android:id="@+id/btnnext"
        android:layout_width="80dp"
        android:layout_height="40dp"
        android:layout_alignParentBottom="true"
        android:layout_alignRight="@+id/rlayout1"
        android:background="@drawable/button"
        android:text="Next" />

        </RelativeLayout>
Doctor Who
  • 747
  • 1
  • 5
  • 28
  • Why you are using HorizontalScrollView inside ScrollView? I think that is the problem. – Pratik Dasa Sep 20 '13 at 07:02
  • You don't need to add HorizontalScrollView inside ScrollView because ScrollView has scrolling functionality for both vertically and Horizontally... – Piyush Sep 20 '13 at 07:11
  • I delete HorizontalScrollView code but not working for me – Doctor Who Sep 20 '13 at 07:43
  • I guess you can use [https://github.com/chrisbanes/PhotoView](https://github.com/chrisbanes/PhotoView) Give it a try. You can get the sample app from [here](https://play.google.com/store/apps/details?id=uk.co.senab.photoview.sample) – Sivakumar S Sep 20 '13 at 07:22

0 Answers0