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
Developer
Shashadhar
Posts: 18
Registered: ‎04-09-2013
My Device: Z10

Carousal in Qml screen

How can i get the carousal effect as blackberry world  first page ?Like every images  slides over another   as i swipe left or right.Please guide me.

 

Thanks,

S D

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Carousal in Qml screen

I could see two quick possibilities. One would be to fudge something up with a sideways ListView or ScrollView, and fiddle with the relative positions of items using the translationX property.

The other would just be to implement it "raw" using absolute positioning and the onTouch event handler for the dragging. I haven't examined at close range the specific behaviour with the "slide over each other" feature, but I don't get the feeling (having used it a few times) that it's doing anything particular magic in that area, so doing it via basic dragging seems likely to me to work okay.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Shashadhar
Posts: 18
Registered: ‎04-09-2013
My Device: Z10

Re: Carousal in Qml screen

Thanks for your reply.

 

But if i use listview or scrollView then i think items will scroll only but won,t have  the feeling of sliding over the other.

 

And in second case any sample code that can help me.

 

Thanks

S D

 

 

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Carousal in Qml screen

That's why I suggested using translationX to adjust their position during the scroll. You'd need a way of tracking the current scroll position in real time, and you'd adjust translationX to artificially offset the other items relative to where they would otherwise be at a given position.

It would probably be tricky... I'm not saying it's the best solution I can think of. I'd only look at using that approach if for some reason absolute positioning and dragging wasn't looking like it was going to work out for you.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!