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: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2
Accepted Solution

how to center a label in a dockLayout which is in a stackLayout?

Container { layout: DockLayout { } Container { id: cAnzeige Label { id: lblHeader textStyle.fontSize: FontSize.XLarge text: "header" } verticalAlignment: VerticalAlignment.Top layout: StackLayout { } } }

 how can i center a label which is inside two containers? the first is a dockLayout and the second is a stackLayout?

Plase "+Like" my post if it was helpful.
Developer
Posts: 75
Registered: ‎09-12-2012
My Device: Looking for a BB10 testing device
My Carrier: Developper

Re: how to center a label in a dockLayout which is in a stackLayout?

[ Edited ]

horizontalAlignment: HorizontalAlignment.Center doesn't work ?

In my case it do, and check that the width of the second container fill the first one.

 

Container {
                layout: StackLayout {  }
                Label {
                    text: "label"
                    horizontalAlignment: HorizontalAlignment.Center
                }

}

 

 

 

---------
Mobile developer freelance - QtQuick - Cascades - WP7 - Android
My works : http://fdelgado.fr
Developer
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2

Re: how to center a label in a dockLayout which is in a stackLayout?

thank you :smileyhappy: i forget to set the parent:

horizontalAlignment: HorizontalAlignment.Fill

 now its fine

Plase "+Like" my post if it was helpful.