Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
xtravanta
Posts: 46
Registered: ‎03-25-2011
My Device: Blackberry Z10
My Carrier: KPN
Accepted Solution

ListView current visible item index

Hi,

 

maby somebody here knows how to do this,

i've got a ListView that only shows 1 item at the time in (scrolling in a horizontal direction)

what signal do i use or how do i get the currently selected item index

this is required because of this example:

 

|--------------------|
|        listview        |
|         item 1        |
|--------------------|
           1/10
 

|--------------------|
|        listview        |
|         item 4        |
|--------------------|
           4/10

 

 

Thx

 

Please use plain text.
Developer
Zmey
Posts: 1,510
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: ListView current visible item index

ListScrollStateHandler can be used to find the first visible item:

http://developer.blackberry.com/cascades/reference/bb__cascades__listscrollstatehandler.html#propert...

Two items can be shown at the same time during scrolling, so I guess additional code will be needed to determine which one is occupying the largest part of the screen.

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.