12-11-2010 01:51 AM
In the Q and A section of the last webcast it was mentioned that it was possible to force an application into landscape or portrait orientation. However, I missed the details on how, and was hoping that someone had the details for doing this...
Solved! Go to Solution.
12-11-2010 02:34 AM
to lock in the orientation you have to edit/add details to your -app.xml descriptor file. open the file and locate the <initialWindow> </initialWindow> tags. Add the following lines somewhere between the two tags (mine are right before the close tag):
that should do the job! good luck!
12-12-2010 09:23 AM
Given that the simulator doesn't support rotation yet and most people here don't have an actual device how are you handling rotation in your apps? Are you simply locking to a certain rotation?
My app was going to use a three pane layout which could easily support portrait but without a way to test it out is it worth trying?
12-12-2010 09:29 AM
the way i go about it is lock in the orientation and dont worry about if the user does decide to put the tablet in portrait mode, for now. at least until the actual device is released or the simulator supports the rotation. in my opinion if you cant test it and you arent 100% sure that your orientation code is working i dont think its worth it to try and do a dynamic repositioning type code. but on a brighter note according to the last webcast they will try to get developers the playbook before consumers get them so we can optimize our coding and possibly be able to do a lot more testing such as the rotation.
12-12-2010 09:34 AM
Thanks for your response.
I'm just getting into Playbook development having done mostly Java + PHP previously so I was just wondering if I had missed something as I've only had to deal with smartphones that don't support rotation until now.
I'll make sure my code has rotation in mind but lock to landscape for now.
12-12-2010 12:07 PM
It was also suggested to just change the size of the width and height of the root Sprite to arrange the GUI. In your layout function, you can simply check if stage.stageWidth > stage.stageHeight for landscape, else portrait. Then it would be to simply listen for the rotation and re-call that function. so you can get everything in place and then once you receive the PB, it would be a sinple uncommenting to the listener and some tweeks.
12-12-2010 08:28 PM
I too am plaining on locking to landscape orientation for version 1. Once I can test on a real device, then I will feel better about having a bit less control over the layout...
12-13-2010 07:08 PM
just checked my descriptor file by unzipping the bar file and the autoOrient tag is still there. how are you package the program?