Zxing Barcode Scanner PhoneGap Plugin iOS landscape mode

非 Y 不嫁゛ 提交于 2019-12-20 05:02:23

问题


I have implement Zxing Barcode Scanner in ipad using PhoneGap 1.7.0 and Zxing Barcode Scanner from https://github.com/phonegap/phonegap-plugins/tree/master/iOS/BarcodeScanner. But the orientation is portrait only. I want to change it to landscape by modify this code

if ([previewLayer isOrientationSupported]) {
    [previewLayer setOrientation:AVCaptureVideoOrientationPortrait];
}

and this code too

if (interfaceOrientation == UIInterfaceOrientationPortrait) return YES;

in CDVBarcodeScanner.mm and change the value of Portrait to LandscapeRight. My problem is video not full screen, there has black portion in right. Also when scan barcode only success when portrait not landscape even in landscape mode.

Is there any solution to make landscape mode perfect?


回答1:


Delete this

if (result.empty() && hints.getTryHarder() && image->isRotateSupported()) {}

on zxing-all-in-one.cpp file



来源:https://stackoverflow.com/questions/10945976/zxing-barcode-scanner-phonegap-plugin-ios-landscape-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!