1

i am using staggardGridView inside a scrollview with an image on top . i want to scroll the image and the list together. `

        <FrameLayout
            android:id="@+id/lighthouseFrameLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/lightHouseImage"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:adjustViewBounds="true"
                />
        </FrameLayout>
        <com.origamilabs.library.views.StaggeredGridView
            android:id="@+id/staggeredGridView2"
            staggered:numColumns="2"
            android:layout_below="@id/lighthouseFrameLayout"
            staggered:drawSelectorOnTop="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </RelativeLayout>

`

1 Answers1

0

First of all if you are using a list view what ever it may be like grid or simple list. no need of scroll view. because in list view it automatically scrolls. coming to image with list then first add scrol view and in scroll view add image and list view. Hva eyou tried that!! Please have a look on this! project. If it helps you please cast a vote.

Tara
  • 2,598
  • 1
  • 21
  • 30
  • sorry by mistake i posted only the have portion of my xml. my xml is exactly as you have mention. but it does not work – Shantanu Bopardikar Apr 25 '15 at 08:20
  • first add relative layout then scroll view,linear layout, image view, grid view. it will work. – Tara Apr 25 '15 at 09:37
  • i tried what you have told ,however it still does not work. if you have seen the pinterest app, when we click on any item of the pinterest listview it opens another activity ; what i want is similar to that. – Shantanu Bopardikar Apr 25 '15 at 09:49
  • for opening anther activity upon clicking listview item then you need to work with position. something like if(position==2) then intent. – Tara Apr 25 '15 at 09:58
  • i am able to open the corresponding image in next activity.the list view also appears ,but they both don't scroll together. – Shantanu Bopardikar Apr 25 '15 at 10:04
  • did u have tried relative, scroll, linear, image and listview in this order? – Tara Apr 25 '15 at 10:08
  • http://stackoverflow.com/questions/16382368/scrollview-distrubing-listview-inside-of-linearlayout?rq=1 go throuhg this, it may help you out. – Tara Apr 25 '15 at 10:14