I'm trying to make a Gallery
widget using HorizontalScrollView
, So inside the HorizontalScrollView
I add ImageView
s, and the problem is that I'm going to add 600+ images!
Can I make some kind of a custom adapter in order to override the GetView
method and utilize convertView
in order to make the app smoother and avoid adding 600+ views at the same time?
Asked
Active
Viewed 1.3k times
3

Omar
- 7,835
- 14
- 62
- 108
-
Gallery is deprecated: http://developer.android.com/reference/android/widget/Gallery.html – Omar Aug 09 '12 at 09:30
1 Answers
7
HorizontalScrollView
can contain only one View
, so you have to draw that whole View
anytime you are drawing any part of it. This could, however, be worked around by
- extending
ViewGroup
as child of yourHorizontalScrollView
- using your custom adapter in that
ViewGroup
and callgetView()
and recycle on your own, drawing only Views that are currently visible in yourHorizontalScrollView
But this would take a lot if your time. I'd at least try something like HorizontalListView
first. A how-to of that specific class can be found here.

Joel Sjögren
- 2,010
- 1
- 13
- 12