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
Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry
Accepted Solution

How to set layout properties of attached objects in bb 10?

I have a custom dialog in attachedObjects[]. How can I set its layout properties to center ? I tried using docklayout but it didn't work.

BlackBerry Development Advisor (Retired)
amarcon
Posts: 155
Registered: ‎07-16-2012
My Device: Dev Alpha

Re: How to set layout properties of attached objects in bb 10?

Hi _NishantShah,

 

Yeap, that's the way but you will need to set the height and width to be able to set it.

 

Check the CustomDialogAlarm.qml file, available under:

 

https://github.com/blackberry/Cascades-Samples/blob/master/cascadescookbookqml/assets/CustomDialogAl...

 

Hope this helps.

Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry

Re: How to set layout properties of attached objects in bb 10?

Sorry but I forgot to mention that I have fixed my orientation to landscape mode. In lanscape the dialog doesn't appear at the center. Even in that cookbook example of fire alarm.

BlackBerry Development Advisor (Retired)
amarcon
Posts: 155
Registered: ‎07-16-2012
My Device: Dev Alpha

Re: How to set layout properties of attached objects in bb 10?

Hi,

 

you will need to set the height and width anyway, if it is fixed you can try something like the sample bellow ( based on cookbook, just changed height and width values).

 

        preferredWidth: 1280 //768 Portrait Width
        preferredHeight: 768 //1280 Portrait Height

 

If you need to support orientation, then you may need to check this https://developer.blackberry.com/cascades/reference/bb__cascades__orientationsupport.html

Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry

Re: How to set layout properties of attached objects in bb 10?

Thanx amarcon.

it works fine