Skip to content

Interface Orientation #5

@convcord

Description

@convcord

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions