PhoneGap Android Barcode Scan UI modification

懵懂的女人 提交于 2019-12-12 16:02:30

问题


Im currently using the Barcode Scanner from the open source library Zxing in my android project. The problem Im facing is concerning the scanning UI

When I launch the Scan window, it occupies the entire screen and Im not sure how to customize it - I would like to add a HTML back button in case the customer wants to scan or even better add the menu bar to be consistent with all other pages on my app ?

How do I add basic HTML elements in the scanning window ?


回答1:


If you are just calling BarcodeScanner via an intent you have no control. However if you are embedding the Java code from the BarcodeScanner app in your app you have all the java code and xml resources available and can edit them how you like. It will all be Java and native Android resource stuff though.. not html.

If you are embedding the layout is

http://code.google.com/p/zxing/source/browse/trunk/android/res/layout/capture.xml

and the activity that does the scanning you want to edit is

http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/CaptureActivity.java

If you add a button in the layout and call finish in the OnClickListener you set up in the activity it would be a back as you desire..



来源:https://stackoverflow.com/questions/9420624/phonegap-android-barcode-scan-ui-modification

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