tags:

views:

20

answers:

1

Hi,

I have a group of images which I would like to display in a horizontal list, the size of the list will vary depending on what option a user selects. However, I am unsure of the best way to implement a list if I have a large number of images to supply to a it, therefore generating many fields that need to be drawn.

My idea to make the list efficient: -Store n images in a circular array. -Display the first 3 images in3 views on the Screen that are visible to the user (e.g. <-- img1 img2 img3 -->) -Keep a record of what's on display.. -When a user scrolls left or right the next/previous image in the array is displayed.
E.g scrolling right once will give me ( <-- img2 img3 img4 --> ) E.g scrolling left 3 times from the above point will give me ( < -- img(n-1) img(n) img1 --> ) and so on...

What would be the best way to do the above, or are there any better ways? I would be grateful if someone could direct me to the relevant documentation, api methods that I should use as well. Is there already a method in the api that can recycle views in a similar fashion...?

I'm using ver v5.0.

I would be grateful for any help. Thanks in advance.

+1  A: 

have you tried PictureScrollField

A slider component that draws a row of images which can be scrolled from side-to-side using the track-ball or touch gestures. The images slide horizontally to align the focus image in a vertically centered position. The images decelerate as they approach their new position to give an animated effect. There are also several configurable effects to highlight the focus image.

All images are allocated the same amount of space on slider (as defined by the constructor's imageWidth and imageHeight parameters). Images can differ from that size in which case the scroll field behaves as follows:

Images are NOT resized. If they are larger than the allocated drawing area they are center aligned and cropped to fit the allocated area. If they are smaller than the allocated drawing area they are center aligned in the allocated area.

Since: BlackBerry API 5.0.0

Vivart
Thanks, that's exactly what I needed!
graftan