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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Contributor
xtravanta
Posts: 45
Registered: ‎03-25-2011
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: 919
Registered: ‎12-18-2012

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.

 

Please use plain text.