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
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Orientation Questions

1. Is there a way to make the app be both orientations - portrait and landscape but force it to start up in landscape mode?

 

2. My landscape and portrait views use different assets. What is the best way to deal with this? I have about 8 image views, in a container. Should I delete this container everytime the orientation changes and reinitiate it with the different assets/image views each time

or

Shoudl I keep all the image views and just change the source of the image each time the orientation changes?

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha

Re: Orientation Questions

yes put the app in Auto-orient in your bar-descriptor.

 

then you will have to force your first page to only accept Lanscape orientation:

 

onCreationCompleted: {
        OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.DisplayLandscape;
    }

 

 

2) no you can simply change the imageSource property of your ImageView to redirect to the landscape format. Use this code to receives events when the orientation changes:

OrientationSupport.orientationChanged.connect(onOrientationChanged);

 

Please use plain text.