0

I have a ScrollView. Inside it I have a list view which has its own scroll mechanism. However I have certain items inside the list view which works only with the listView scroll i.e not all the items are displayed of the list view inside the parent layout.

      <ScrollView
            android:id="@+id/scrollView1"
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

             // SOME CODE
    <ListView
                        android:id="@+id/latsttrans"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentTop="true"
                        android:layout_weight="1" >
                    </ListView>
// SOME CODE
</ScrollView>

I want to disable the scroll of listview so that I can access the parent layout and the listview items with the ScrollView itself. Any ideas ?

TechFrk
  • 185
  • 2
  • 2
  • 15
  • i fdont think listview will be scrolling inside scrolview ?isnt it? nested srcollview does not workin android – KOTIOS Mar 19 '15 at 12:42
  • You should never put a `ListView` inside of a `ScrollView`. These are two "scrolling" views. Do you not see a warning in Android Studio? – Jared Burrows Mar 19 '15 at 13:08
  • possible duplicate of [How can I put a ListView into a ScrollView without it collapsing?](http://stackoverflow.com/questions/3495890/how-can-i-put-a-listview-into-a-scrollview-without-it-collapsing) – Jared Burrows Mar 19 '15 at 13:08
  • @ Jared Burrows I haven't yet updated to Android studio. In eclipse there is no warning ! – TechFrk Mar 19 '15 at 13:11

1 Answers1

0

Try LinearLayout instead of ListView and add child views in linear layout using addChild() method of LinearLayout. Inflate views using LayoutInflater and add those to LinearLayout.

Arun Kumar
  • 194
  • 8