简体   繁体   English

黑莓有效的可滚动水平列表

[英]blackberry efficient scrollable horizontal lists

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. 我的想法是使列表高效:-将n个图像存储在圆形数组中。 -Display the first 3 images in3 views on the Screen that are visible to the user (eg <-- 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. -在屏幕上的3个视图中显示用户可见的前3个图像(例如<-img1 img2 img3->)-保留所显​​示内容的记录。-当用户向左或向右滚动下一个/显示阵列中的上一张图像。
Eg scrolling right once will give me ( <-- img2 img3 img4 --> ) Eg scrolling left 3 times from the above point will give me ( < -- img(n-1) img(n) img1 --> ) and so on... 例如,向右滚动一次会给我(<-img2 img3 img4->)例如,从上述位置向左滚动3次会给我(<-img(n-1)img(n)img1->)和等等...

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. 如果有人可以将我引向相关文档以及我应该使用的api方法,我将不胜感激。 Is there already a method in the api that can recycle views in a similar fashion...? API中已经有一种方法可以以类似的方式回收视图...?

I'm using ver v5.0. 我正在使用ver v5.0。

I would be grateful for any help. 我将不胜感激。 Thanks in advance. 提前致谢。

have you tried PictureScrollField 你尝试过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). 所有图像在滑块上都分配了相同的空间(由构造函数的imageWidth和imageHeight参数定义)。 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 由于:BlackBerry API 5.0.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM