Search code examples
iosxcodecordovaphonegap-pluginszxing

Modify scanner UI to be a rectangular portrait vs 320x480


I would like to be able to modify the green box and the red strip on the scanner UI to be a rectangular scan vs a 320x480 always.

I have added debugging notes and found out that when the loadView gets called, it always sets the previewLayer's dimensions to 320x480

How can I change that?

I was able to do this in Android by editing the MIN and MAX width parameters

Help appreciated.


Solution

  • with these three solution you can achieve your goal, the third option is the most efficient but the worst in code maintainability, the first, if applicable, is the best:

    1. From the original repository of the iOS versions of this plugin you can find this guide to costumize your overlay view.
    2. You can try to work on the overlay directly from code, here you can find a way to do that.
    3. Finally you can fork the GIthub project and work directly to the affected source, in this case in the method (UIImage*)buildReticleImage contains all you need to change this behavior.

    Hope this help!