天天看點

ZXing豎屏掃描

zxing實作豎屏掃描

第一步:修改AndroidManifest清單檔案,删除AndroidManifest中CaptureActivity的screenOrientation屬性:

第二步:删除CaptureActivity中把onResume方法中的無用代碼:

第三步:在CaptureActivity中把onCreate方法結尾處添加代碼:

第四步:在CameraConfigurationManager的setDesiredCameraParameters方法中添加代碼:

第五步:修改CameraManager中getFramingRectInPreview方法:

第六步:修改DecodeHandler中的decode(byte[] data, int width, int height)方法:

前添加代碼