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: 101
Registered: ‎01-06-2014
My Device: Q10
My Carrier: EE
Accepted Solution

Labels not close enough when stacked

I'm trying to put two labels one on top of the other but when I do they still seem far apart. How can I bring then closer to each other?

 

        Label {
            text: "Hello World"
            textStyle.color: Color.create("#868F98")
            
        }
        Label {
            text: "Goodbye"
            textStyle.color: Color.create("#868F98")
        } 

 

BlackBerry Development Advisor
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Labels not close enough when stacked

[ Edited ]

Hi macaronlover,

 

Have you considered placing the two controls in a StackLayout? There you can then adjust the layout properties (margins, etc.) to place the controls exactly where you want them to be.

 

Docs: http://developer.blackberry.com/native/documentation/cascades/ui/layouts/index.html

API ref: http://developer.blackberry.com/native/reference/cascades/bb__cascades__stacklayout.html

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Developer
Posts: 1,650
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Labels not close enough when stacked

if nothing helps

try translateY: -20 or so

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner