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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
New Developer
rwomack
Posts: 8
Registered: ‎02-20-2009
Accepted Solution

Force Portrait Mode

I need my opengl based game to always be in portrait mode, but if I launch it whilst in landscape mode it fails to enter portrait, I have set the following in bar-descriptor.xml, what else do I need to do?

 

<initialWindow>
<aspectRatio>portrait</aspectRatio>
<autoOrients>false</autoOrients>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
</initialWindow>

 

Thanks for any assistance.

Roger

Please use plain text.
BlackBerry Development Advisor
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: Force Portrait Mode

Hi there,

 

Welcome to the forums!

 

Your XML settings seem correct at a glance - Can you try setting the option from the GUI and rebuilding your application?

 

(in the GUI's "Design Mode", look to the top right hand corner for a Portrait icon. Select it, save and rebuild your application).

 

Let me know if you are still having this issue.

 

Cheers,

 

Martin

 

Please use plain text.
New Developer
rwomack
Posts: 8
Registered: ‎02-20-2009

Re: Force Portrait Mode

Hi Martin,

 

Thanks for the reply, I went through all the settings, and it still does it, but what I didi realise is, it displays the default screen in portrait initially, and then switches back to landscape. Do I need to add code to check the screen size and rotate if in the wrong mode?

 

Thanks

Roger

Please use plain text.
BlackBerry Development Advisor
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: Force Portrait Mode

Roger,

 

I understand that if you start your applicaiton in Landscape mode, it wll initially launch in portrait and switch to landscape afterwards. However, once launched, if you tilt back your application into Portrait mode, does the application change to Portrait mode?

 

Martin

Please use plain text.
BlackBerry Development Advisor
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: Force Portrait Mode

Hi Roger,

 

Have you made any progres on this?

 

Martin

Please use plain text.
New Developer
rwomack
Posts: 8
Registered: ‎02-20-2009

Re: Force Portrait Mode

Hi Martin,

 

I'm hoping my tech guy has a solution, been told he has, so hope to implement, test and resubmit today.

 

Thanks for your support

Roger

Please use plain text.
Developer
BGmot
Posts: 966
Registered: ‎11-24-2011
My Carrier: x

Re: Force Portrait Mode

Have you looked at:

navigator_set_orientation()

navigator_rotation_lock()

?

 

Please use plain text.
Contributor
II_ARROWS
Posts: 40
Registered: ‎03-02-2012
My Carrier: Vodafone

Re: Force Portrait Mode

[ Edited ]

If you look at the bar-descriptor.xml into the application tab, you can set the orientation mode between auto-orient, portrait and landscape.

 

This is what it looks in text mode after I set it to portrait mode:

 

    <initialWindow>
        <aspectRatio>portrait</aspectRatio>
        <autoOrients>false</autoOrients>
        <systemChrome>none</systemChrome>
        <transparent>false</transparent>
    </initialWindow>

 

 

Please use plain text.
New Developer
rwomack
Posts: 8
Registered: ‎02-20-2009

Re: Force Portrait Mode

Hi All,

 

Thanks for all your responses, this issue is now resolved and 'Football Director' has been resubmitted for approval. I havent got the answer yet from the programmer who resolved it, but if  I can I will post the solution when I am told. 

 

Regards

Roger

Please use plain text.
Contributor
Jaime_Barrachina
Posts: 21
Registered: ‎10-25-2012
My Carrier: None

Re: Force Portrait Mode

I know this post is a bit old. But if you found the solution it would be much appreciated as we're having the same issue. 

Please use plain text.