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: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

StackLayout Label spacing

Hey Developers

 

I have a vertical stacklayout and I was wondering if I can get the spacing between the Labels inside the stacklayout smaller.

 

Container {
    leftPadding: 5
    layout: StackLayout { }
    
    Label { 
        text: ListItemData.location
        textStyle.fontSize: FontSize.Large
    }
    
    Label {
        text: ListItemData.status
        textStyle.fontSize: FontSize.Small
        textStyle.color: Color.Gray
    }
}

 

Could not find anything in the documentation about it.

 

Thanks in advance

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

Re: StackLayout Label spacing

Try setting both margins and padding to 0. But some spacing will still be there. As a workaround set Label's translationY. It's inconvenient because Label's logical coordinates will not change, but it's currently the only method to place labels closer.

 


Andrey Fidrya, @zmeyc on twitter