0

I am trying to add listview in scollview , Scrollview is my main layout it consist multiple Relative layouts one of them consist ListView but it is showing only two records, for all records i need to set height manualy . But this is not the good solution for me .

Any alternative please ?

Thanks

Amit Sharma
  • 928
  • 2
  • 10
  • 34
  • 2
    http://stackoverflow.com/questions/5415011/listview-inside-a-scrollview – Shivang Trivedi Oct 28 '13 at 12:54
  • 1
    why do you need that lsitview scrolls by itself. remove the scrollview – Raghunandan Oct 28 '13 at 12:54
  • Yes i know that but there is requirement . It is a lagrg screen consist Multiple controls as well ListView , thats why i have to use scrollview . But Because of scrollview ListView Shows only two records – Amit Sharma Oct 28 '13 at 12:57
  • You should never use a ScrollView with a ListView, because ListView takes care of its own vertical scrolling. Most importantly, doing this defeats all of the important optimizations in ListView for dealing with large lists, since it effectively forces the ListView to display its entire list of items to fill up the infinite container supplied by ScrollView. http://developer.android.com/reference/android/widget/ScrollView.html – Raghunandan Oct 28 '13 at 12:58
  • It is possible to use it inside ScrollView, but that is just ridiculous. You might wanna move the other views above ListView and put them in a new Layout which Scrolls, and Put ListView at bottom, so it has a free hand. – Dhaval Oct 28 '13 at 13:17

1 Answers1

1

this is very good example how to add listview inside scrollview http://www.androidhub4you.com/2012/12/listview-into-scrollview-in-android.html

Shivang Trivedi
  • 2,192
  • 1
  • 19
  • 26