[MOD-1909] iOS: Ti.Barcode Rotation issue
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-10T06:24:30.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Ti.Barcode 1.10.1 |
Components | Barcode |
Labels | TCSupport |
Reporter | Isaac Payne |
Assignee | Vijay Singh |
Created | 2014-06-12T00:02:20.000+0000 |
Updated | 2018-08-06T17:49:30.000+0000 |
Description
Problem Description
I'm having an issue with the Ti.Barcode module where when the device is rotated the barcode scanning screen rotates also, even though device orientation is set to Ti.UI.PORTRAIT in the tiapp.xml fileTESTING ENVIRONMENT
Ti CLI 3.3.0 Titanium SDK: 3.3.0.GA and 3.2.X.GA iPhone and iPad DeviceTEST CODE
var Barcode = require('ti.barcode');
Barcode.allowRotation = true;
Barcode.displayedMessage = '';
Barcode.useLED = true;
var window = Ti.UI.createWindow({
backgroundColor : 'white'
});
var scrollView = Ti.UI.createScrollView({
contentWidth : 'auto',
contentHeight : 'auto',
top : 0,
showVerticalScrollIndicator : true,
layout : 'vertical'
});
var scanCode = Ti.UI.createButton({
title : 'Scan Code',
width : 200,
height : 60,
top : 20
});
scanCode.addEventListener('click', function() {
Barcode.capture({
animate : true,
showCancel : false,
showRectangle : false,
keepOpen : true
});
});
scrollView.add(scanCode);
window.add(scrollView);
window.open();
~~~~~~~~~~~~~~~~~~
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
</iphone>
<modules>
<module platform="iphone">ti.barcode</module>
</modules>
~~~~~~~~~~~
STEP TO TEST
- Create a new project - Update "app.js" file with "app.js" code segment given above. - Download the barcode module zip file [ti.barcode-iphone-1.8.3.zip](https://github.com/appcelerator/titanium_modules/blob/master/barcode/mobile/ios/ti.barcode-iphone-1.8.3.zip?raw=true) - Extract the zip file, copy the module folder to your app - Include "tiapp.xml" code segment given above to the "tiapp.xml" file - Run the app in iPhone or iPad device. - Touch "scan Code" to see the barcode scanning screen - Rotate the device and see problemOBSERVED RESULT
Rotating the device is causing the rotation of barcode scanning screen, even though the orientation was fixed to portrait.Attachments
File | Date | Size |
---|---|---|
BarcodeBug.png | 2014-06-12T00:02:20.000+0000 | 281359 |
Scanner_rotation.png | 2014-10-20T16:13:53.000+0000 | 245626 |