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
New Developer
Posts: 10
Registered: ‎09-30-2012
My Device: Bold 9900
Accepted Solution

Strange issue - ListItem width

While developing application I have noticed strange issue.

 

When I design list item layout in qml, It looks nice on preview:

I set 

horizontalAlignment: HorizontalAlignment.Fill

 and the width of list item fill all empty space, but when I check the list on Simulator it wraps width to content width?

 

Does anyone know how to set listItem width to fill all space from left to right?

 

To sum up,

I want to have (and it looks like this on qml preview):

listitems_want.png

 

but I get this (width of list item fits only to the content):

listitems_have.png

 

 

Thanks in advance.

Developer
Posts: 75
Registered: ‎09-12-2012
My Device: Looking for a BB10 testing device

Re: Strange issue - ListItem width

Hi, there is maybe more simple but for me this works using spaceQuota :

 

ListItemComponent {
    type: "item"
    Container {
        
        background: Color.Red
        Container {
            preferredHeight: 230     
            
            layout: StackLayout {
                orientation: LayoutOrientation.LeftToRight
            }
            
            Container {
                
                layoutProperties: StackLayoutProperties {
                    spaceQuota: 1
                }
             }
         }
     }
}
            
            
      

 

---------
Mobile developer freelance - QtQuick - Cascades - WP7 - Android
My works : http://fdelgado.fr
New Developer
Posts: 10
Registered: ‎09-30-2012
My Device: Bold 9900

Re: Strange issue - ListItem width

Thanks! That works. I've changed my list item layouts and now it looks fine.