Question

As my Linphone adventure continues, I am now able to compile it and run it on my dev ipad. One problem I have with the app is that it's orientation is always the same as the device's orientation. I have read through some answers around here about this, but none seem to work for me. I'm very new to iOS development and Mac usage in general. From what I understand, I can set my orientation settings in the root view, but I have no clue which one that is.

The current situation:
The introscreen is always in landscapeleft mode (home button to the left of the device).
Every other view is automatically rotated when I rotate the device.

What I have tried:
I tried copying the following code to all my views, which did not seem to do anything at all.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft) return YES;
    return NO;
}

I tried setting the 'Supported interface orientations' and 'Supported interface orientations (iPad)' to 'Landscape (left home button)' (deleted the other entries).
I have also used the code sample in a few different formats, as suggested in similar questions on SO and other forums. So I doubt the code is wrong.

Additional details:
I'm using the latest version of linphone.
I'm using xcode 4.6.1.
I'm using an iPad 3 and an iPad 4 for testing both with firmware 6.1.3, I also tried the simulators that come with xcode.
I'm running xcode on an iMac with Mountain Lion 10.8.3.

The weird thing is that the code worked for the introscreen (a simple splash screen, showing the linphone logo and name), but not for any other view.

How do I lock my entire app in the landscape left orientation (so the app is viewed correctly when the home button is on the left side of the device)?

Was it helpful?

Solution

Apparently, rotation is handled by the Linphone SDK, I found it in linphonecore.c. After I edited this file and compiled the whole SDK again, my view was succesfully locked in landscape left mode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top