在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]];
你應該刪除你不想要的這些線路調用。
謝謝!這聽起來不錯,但我無法讓它工作。我甚至改變了添加所有格式的循環,因此它只添加了一個(Aztec)'[result addPossibleFormat:[@ 0 intValue]];'但我的應用程序仍將UPCE報告爲檢測到的條碼類型。奇怪的。 – oelna