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
Posts: 27
Registered: ‎06-24-2013
My Device: Z10
Accepted Solution

ListView right align item with preferred width

[ Edited ]

Hello,

 

I have a ListView with two types of items.

Both items have a preferred width of 650. Now I would like one item type to align to the right of the list and the other one to the left. But whatever I'm trying to achieve this, the items stay on the left with the remaining space left empty to the right.

Has anyone any idea on how to do this?

 

This is a picture of what I would like to achieve:

Image

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: ListView right align item with preferred width

Hi,
In the container which contains the items add preferredWidth: Infinity property and it will stretch to full ListView width.

Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 27
Registered: ‎06-24-2013
My Device: Z10

Re: ListView right align item with preferred width

Thank you, that did the trick Smiley Happy