BarcodeView icon indicating copy to clipboard operation
BarcodeView copied to clipboard

Interface Orientation

Open convcord opened this issue 10 years ago • 1 comments

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.

convcord avatar Feb 23 '15 20:02 convcord

Hi , did you got any solution?

koolll avatar Aug 30 '15 01:08 koolll