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
dhaneshshastri
Posts: 28
Registered: ‎12-19-2012
My Device: BB 10
My Carrier: BB
Accepted Solution

Further adjusting Layout With Offsets

Hello all,

Can any one here tell me, that is there a way by which I can do minor adjustments to my controls once they are layout-ed ?

Ex.

 

I have a base container which is a 'dockLayout' container, I have added two child containers to it, one with HorizontalAlignment::Left and another with HorizontalAlignment::Right.

But I want the Left one (1 st one) to be slightly shifted towards the left, means in other words 'its left edge minus a value'. Say 'Offset = -10'.

 

Can this be done?

Please dont suggest me 'AbsoluteLayout'.

 

Please see the attached Images,

The first Image is the output with the current layout (DockLayout) the background is the MAster container and inside that another container (Red) and inside that ImageView (Car).

The Red Container is the Left Aligned.

 

Screen Shot 2014-04-28 at 10.58.41 pm.png

 

 

And now the Expected output as I want, Please Ignore my pathetic Image editing skils :smileytongue: just look at the Red Container and the Car Within, they are moved towards left.

So by keeping all the related Layout settings intact, can I set an Offset for such adjustments ?

Screen Shot 2014-04-28 at 10.58.41 pm copy.png

Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Further adjusting Layout With Offsets

You can use the translation properties, translationX and translationY...

 

http://developer.blackberry.com/native/reference/cascades/bb__cascades__visualnode.html#property-tra...


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
New Developer
dhaneshshastri
Posts: 28
Registered: ‎12-19-2012
My Device: BB 10
My Carrier: BB

Re: Further adjusting Layout With Offsets

Thanks for suggestion, Offcource, it will work.

 

But I would consider using translations If I want to play with the animations part or transitions, I think there should be a property like this along with the Layouts to fine tune the Layouting.

Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Further adjusting Layout With Offsets

No, there is only translation (which as you say can also be used with animation) or the AbsoluteLayout properties.
These are sufficient to fine tune the layout, nothing else is needed.

If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.