Search code examples
cordovaionic-frameworkcordova-pluginsbarcode-scanner

BarcodeScanner image upside down on tablet


I am using Telerik BarcodeScanner plugin (http://plugins.telerik.com/cordova/plugin/barcodescanner) to add qr-code scanning function to my hybrid app. The plugin works well, except on tablet where the image is displayed upside down. This only happen on tablet, and no issue on phone. I have tried with several device, but it all happen upside down on tablet device.

Do anyone of you face this issue? How can I fix it?


Solution

  • i'm using this plugin too! i feel same problem.

    i fixed it adding screenOrientation in AndroidManifest.xml for scan activity. take a little look at your AndroidManifest.xml (how it will must be):

    <activity android:clearTaskOnLaunch="true"  android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:exported="false" android:name="com.google.zxing.client.android.CaptureActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden">
                <intent-filter>
                    <action android:name="com.google.zxing.client.android.SCAN" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </activity>
    

    note that android:screenOrientation="landscape" has added. unfortunately forces your view stay in "landscape" but your camera shows image in correct way.