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
New Developer
rwomack
Posts: 8
Registered: ‎02-20-2009
My Device: Not Specified
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

BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

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

 

New Developer
rwomack
Posts: 8
Registered: ‎02-20-2009
My Device: Not Specified

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

BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

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

BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: Force Portrait Mode

Hi Roger,

 

Have you made any progres on this?

 

Martin

New Developer
rwomack
Posts: 8
Registered: ‎02-20-2009
My Device: Not Specified

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

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Force Portrait Mode

Have you looked at:

navigator_set_orientation()

navigator_rotation_lock()

?

 

Contributor
II_ARROWS
Posts: 45
Registered: ‎03-02-2012
My Device: Torch 9810

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>

 

 

New Developer
rwomack
Posts: 8
Registered: ‎02-20-2009
My Device: Not Specified

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

Contributor
Jaime_Barrachina
Posts: 21
Registered: ‎10-25-2012
My Device: Blackberry Playbook 2.0

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.