PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Screen orientation problem when using iPhone UI with Edgelib

Hello,

I'm using edgelib with facebook connect iphone api.
I want to add a simple connect button on the view but in landscape mode.
I added the Info.plist property "Initial interface orientation" in "Landscape (right home button)".
I also set up the edgelib orientation flag to DOR_LANDSCAPE in OnDisplayConfig.
But this doesn't seems to do anything, I still have to correct the orientation using opengl rotation/translation + correcting the x/y touch point by hand.
But the main problem is that my connect button added by facebook connect api is not rotated in landscape mode.
Do you know how can I solve this issue ?

Thank you.
Hi Orion,

To rotate native iPhone UI elements, use the following call:

Code:

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
thanks for the answer.
This is working for one part of the problem, the keyboard is now in the correct orientation.
But the facebook button is still not rotated.
Hi Orion,

Are you calling the function above before creating the facebook button? Alternatively you can call the following function on your UIView:

Code:

youruiview.transform = CGAffineTransformMakeRotation(M_PI * 0.5);
Hi,

edge wrote:Are you calling the function above before creating the facebook button?

I tried before and after creating the button and it didn't worked.

edge wrote:Alternatively you can call the following function on your UIView:

Code:

youruiview.transform = CGAffineTransformMakeRotation(M_PI * 0.5);

I tried this and it rotated all the edgelib opengl surface which was a bit annoying. :/
Then I tried using this transform on the facebook button only and it worked !

Thank you for the code hint !