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

Adobe AIR Development

Reply
Developer
mplacona
Posts: 80
Registered: ‎03-17-2011
My Device: Playbook Tablet
My Carrier: -

App orientation

Hi, I have seen lots of people talking about app orientation, and how to get it to work. I've tried many ways last night, but couldn't get anything to work properly.

 

I've locked my apps to always be landscape for the meantime, and this seems to work well, but I'd like to have them working both ways, but can't get it to scale properly, as when I change orientation to portrait, my app simply crops in half.

 

I'm wondering if anyone has any definitive way of doing it, and if anyone could give me some tips on how to accomplish it.

 

With kindest regards,

Marcos Placona
www.placona.co.uk
My Playbook Apps:
Bonjour | Time Traveller | Magic Ball
Please use plain text.
Developer
billfoust
Posts: 382
Registered: ‎05-19-2008
My Device: BlackBerry Torch
My Carrier: AT&T

Re: App orientation

For the apps I've done, I completely reposition all of the elements on the screen so that it looks nice in that orientation. I was never happy with the scaling when I saw it.

 

Generally, I create all of the elements in a constructor nd then call a Layout method which positions them based on the current orientation.

Bill
-------------------------------------------
Check out my book on BlackBerry Development for Java.
And my other really really old book
My Apps: FlashKids
Please use plain text.
Developer
mplacona
Posts: 80
Registered: ‎03-17-2011
My Device: Playbook Tablet
My Carrier: -

Re: App orientation

Is it really the only way though? No other way of doing it automatically (programmatically)?

Marcos Placona
www.placona.co.uk
My Playbook Apps:
Bonjour | Time Traveller | Magic Ball
Please use plain text.
Developer
billfoust
Posts: 382
Registered: ‎05-19-2008
My Device: BlackBerry Torch
My Carrier: AT&T

Re: App orientation

There is seldom only one way to do something. You can use the autoscaling, but like I said, I wasn't happy with it when I saw it. I think your original post was asking how to scale it properly, and I can't really answer that since I didn't actually do it that way.  I THINK its just a matter to setting the auto scale to true in your XML file, but it sound slike you've tried that and aren't happy with it.

Bill
-------------------------------------------
Check out my book on BlackBerry Development for Java.
And my other really really old book
My Apps: FlashKids
Please use plain text.
Regular Contributor
sberfield
Posts: 68
Registered: ‎03-18-2011
My Device: Playbook Developer
My Carrier: none

Re: App orientation

My app is 600 x 600 so it can sit comfortably in the middle of the screen in either orientation. I set scaling to NO_SCALE and alignment to TOP_LEFT. then use an event listener for the screen resize event to position the app in the middle of the stage. The one I am working on now will do the same thing. The one after that will require two different screen layouts depending on the orientation, and so I'll have a routine to re-position the necessary elements on the change. Depends a lot on what you are trying to do.

Two apps and counting:
Video Poker: http://appworld.blackberry.com/webstore/content/33870
Classic Slots: http://appworld.blackberry.com/webstore/content/40279
Please use plain text.