在ZXDecodeHints 类中,您可以使用这些方法添加或删除扫描仪识别的格式。
- (void)addPossibleFormat:(ZXBarcodeFormat)format;
- (BOOL)containsFormat:(ZXBarcodeFormat)format;
- (int)numberOfPossibleFormats;
- (void)removePossibleFormat:(ZXBarcodeFormat)format;
这样你就可以删除你不想要的格式:
[hints removePossibleFormat:kBarcodeFormatQRCode]
以下是 lib 使用的格式列表:
typedef enum {
/** Aztec 2D barcode format. */
kBarcodeFormatAztec,
/** CODABAR 1D format. */
kBarcodeFormatCodabar,
/** Code 39 1D format. */
kBarcodeFormatCode39,
/** Code 93 1D format. */
kBarcodeFormatCode93,
/** Code 128 1D format. */
kBarcodeFormatCode128,
/** Data Matrix 2D barcode format. */
kBarcodeFormatDataMatrix,
/** EAN-8 1D format. */
kBarcodeFormatEan8,
/** EAN-13 1D format. */
kBarcodeFormatEan13,
/** ITF (Interleaved Two of Five) 1D format. */
kBarcodeFormatITF,
/** MaxiCode 2D barcode format. */
kBarcodeFormatMaxiCode,
/** PDF417 format. */
kBarcodeFormatPDF417,
/** QR Code 2D barcode format. */
kBarcodeFormatQRCode,
/** RSS 14 */
kBarcodeFormatRSS14,
/** RSS EXPANDED */
kBarcodeFormatRSSExpanded,
/** UPC-A 1D format. */
kBarcodeFormatUPCA,
/** UPC-E 1D format. */
kBarcodeFormatUPCE,
/** UPC/EAN extension format. Not a stand-alone format. */
kBarcodeFormatUPCEANExtension
} ZXBarcodeFormat;
同样在ZXMultiFormatReader 类中,您应该删除存储不同格式的数组读取器中的对象。
[self.readers addObject:[[ZXQRCodeReader alloc] init]];
[self.readers addObject:[[ZXDataMatrixReader alloc] init]];
[self.readers addObject:[[ZXAztecReader alloc] init]];
[self.readers addObject:[[ZXPDF417Reader alloc] init]];
[self.readers addObject:[[ZXMaxiCodeReader alloc] init]];
您应该删除这些您不想要的线路呼叫。