Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface Orientation #5

Open
convcord opened this issue Feb 23, 2015 · 1 comment
Open

Interface Orientation #5

convcord opened this issue Feb 23, 2015 · 1 comment

Comments

@convcord
Copy link

Awesome work Mike! This is an excellent module that I'm using in one of my projects.

Now I'm trying to use the landscape mode of the ZBarReaderView instead of transforming the view in the appcelerator side (rotation)

Here's what I'm trying in ComMfoggBarcodeView.m without success:

-(NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}

-(BOOL)shouldAutorotate {
    return YES;
}

-(void)willRotateToInterfaceOrientation: (UIInterfaceOrientation)toInterfaceOrientation
                                 duration: (NSTimeInterval)duration;
{
    if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
        [self square].previewTransform = CGAffineTransformMakeRotation(M_PI_2);
    } else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        [self square].previewTransform = CGAffineTransformMakeRotation(-M_PI_2);
    } else if (toInterfaceOrientation== UIInterfaceOrientationPortraitUpsideDown) {
        [self square].previewTransform = CGAffineTransformMakeRotation(M_PI);
    } else {
        [self square].previewTransform = CGAffineTransformIdentity;
    }
}

I really appreciate any help you can provide.

@koolll
Copy link

koolll commented Aug 30, 2015

Hi , did you got any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants