[ 
https://issues.apache.org/jira/browse/CB-1511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13459565#comment-13459565
 ] 

Klaus Schmidt commented on CB-1511:
-----------------------------------

Hi Shazron, hi Becky,

I found out a workaround for "CDVCapture.m":
Between implementation of "CDVCapture" and the implementation of 
"CDVAudioRecorderViewController" I inserted an implementation of 
"UINavigationController". In this implementation I implement the 
"supportedInterfaceOrientations"-method and return the orientations of the 
"CDVAudioRecorderViewController":

@implementation UINavigationController (iOS6OrientationFix)

-(NSUInteger) supportedInterfaceOrientations {
    return [self.topViewController supportedInterfaceOrientations];
}

@end

Additional I extended the implementation of "CDVAudioRecorderViewController" 
with the two methods "supportedInterfaceOrientations" and 
"preferredInterfaceOrientationForPresentation":


- (NSUInteger)supportedInterfaceOrientations
{
    NSUInteger ret = 0;
    if ([self 
shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationPortrait])
        ret = ret | (1 << UIInterfaceOrientationPortrait);
    if ([self 
shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationPortraitUpsideDown])
        ret = ret | (1 << UIInterfaceOrientationPortraitUpsideDown);
    return ret;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationPortrait;
}


Now it works and the behaviour in iOS 6 is the same as in iOS 5.1.1: Only the 
portrait mode is supported, as it always was, and the Capture-View doesn't 
rotate any more.

'Cause I'm not a professional in iOS-programming and not a professional in 
Cordova-development, I'm not sure, that this is the correct and only way for 
the issue solution. But for me it works and for you it is a hint where to look 
in the code.

I hope you can work with my hint.

Greetings,
Klaus.
                
> Cordova 2.1/2.2 Audio Capture iOS6 CDVAudioRecorderViewController wrong 
> orientation
> -----------------------------------------------------------------------------------
>
>                 Key: CB-1511
>                 URL: https://issues.apache.org/jira/browse/CB-1511
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0, 2.2.0
>         Environment: iOS6, iPad3, Cordova 2.1.0 with 2.2.0-fix CB-1465
>            Reporter: Klaus Schmidt
>            Assignee: Becky Gibson
>             Fix For: 2.2.0
>
>         Attachments: screenshot1.PNG, screenshot2.PNG
>
>
> Hi,
> I've running the actual code of Cordova 2.1.0 with the mainViewController-fix 
> CB-1465.
> If I want to capture an Audio-File when the app is in landscape mode, the 
> CDVAudioRecorderViewController has the wrong orientation (screenshot1), the 
> orientation is not fixed in portrait mode, it is, like the other app, running 
> in landscape mode. If I rotate the iPad to portrait mode, the 
> CDVAudioRecorderViewController is displayed correctly (screenshot2).
> Can you please fix this? I think, you can set the orientation to 
> portrait-mode to a fix portrait-mode orientation, but I don't know how...
> Thanks and greetings,
> Klaus.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to