【发布时间】:2018-07-12 13:45:28
【问题描述】:
我在MainActivity.kt 中展示了针对不同需求的不同片段。在某个时候,我按下按钮“X”调用startScanner() 函数:
private fun startScanner() {
IntentIntegrator(this)
.setOrientationLocked(false)
.setPrompt("SCANNING?")
.initiateScan()
}
Manifest.xml:
<activity
android:name=".MainActiity"
android:theme="@style/AppTheme"
tools:replace="android:screenOrientation"
android:stateNotNeeded="true"
android:screenOrientation="fullSensor"
android:windowSoftInputMode="stateHidden" />
Gradle.file:
compile 'com.journeyapps:zxing-android-embedded:3.6.0'
它确实会打开扫描仪和所有内容,但处于横向模式。
为什么这不起作用?
【问题讨论】:
标签: android orientation zxing barcode-scanner