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

Posts: 193
Registered: ‎12-29-2010
My Device: Bold 9900
My Carrier: Rogers
Accepted Solution

list item image size



Anybody know the size in the list item image? My smaller images get stretched to fill it, and the large images get shrunk to fit it. It's quite annoying since it doesn't allow any flexibility. 


I want an image to display in the center of the image holder in a list. But it doesn't seem possible, unless I manually create a white background with an image in it, resized to a proper size.


Any ideas?





Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: list item image size

using a custom list layout with ImageView doesn't help ?

try setting minwidth, maxwidth, scaling ....

ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: list item image size

I think it's better to create a custom list item. Default list item has another problem: separators between items are thick, but top and down ones are thin. Smiley Sad On system screens every item has only bottom separator.


Here's how I position content in custom list item:


        Container *imageContainer = Container::create()
                        .preferredSize(121, 109)
                        .add(imageView_ = ImageView::create()

        Container *imageAndContentContainer = Container::create()

        Container *separatorContainer = Container::create()

        Container *selectionContainer = Container::create()
                        .add(borderImageView_ = ImageView::create("asset:///images/other/selectedControlBorder.amd")



Andrey Fidrya, @zmeyc on twitter