【发布时间】:2018-12-13 17:18:49
【问题描述】:
我遇到了 Ionic 的问题。我已经实现了 Phonegap Bar 的条形码扫描仪,它工作正常。我的问题是我希望在激活/打开条形码扫描仪时显示导航栏,但条形码扫描仪始终全屏并忽略导航栏。
我该怎么做?
我的 tab-scanner.html
<ion-view view-title="Scanner">
<ion-content>
<center>
<!-- Beim Klick des Buttons wird die Methode Scan() ausgeführt -->
<button class="button button-assertive" ng-click="scan()">
Scan
</button>
<!-- Methode Fetch wird mit dem Parameter blabla ausgeführt -->
<button class="button button-positive" ng-click="fetch(4001513007704)">
Ean
</button>
</center>
</ion-content>
</ion-view>
My Scanner-Controller:
.controller('ScannerCtrl', function($scope, dataService, dataFactory) {
$scope.scan = function() {
cordova.plugins.barcodeScanner.scan(function(result) {
$scope.fetch(result.text);
}, function(error) {
alert(JSON.stringify(error));
});
};
$scope.fetch = function(ean) {
dataService.eanData(ean).then(function(dataResponse) {
dataFactory.setData(dataResponse.data);
});
};
})
来自应用程序的图像: If you click on the scan button the scanner is opening
【问题讨论】:
-
你试过定位导航栏和条形码扫描仪吗?
-
什么意思?
-
您是否尝试过在导航栏和条码扫描仪上定位。
-
我不知道该怎么做,所以我很确定我没有尝试过。你能给我一些示例代码吗?谢谢!
标签: angularjs cordova ionic-framework