Here's how to find a solution:
Http://stackoverflow.com/questions/26797321/not-able-to-convert-zxing-into-portrait-mode-in-android
The second important step
2 I in Cameramanager class, method Getframingrect Replace
int width = min_frame_width; int height = min_frame_height;if ( Context.getresources (). GetConfiguration (). orientation ==configuration.orientation_portrait) { int tmp = 7 * screenResolution.x / 8; width = (TMP) < MIN_FRAME_WIDTH ? MIN_FRAME_WIDTH : (TMP); tmp = 1 * screenresolution.y / 3; height = (TMP) < MIN_FRAME_WIDTH ? MIN_FRAME_WIDTH : ((TMP) > MAX_FRAME_HEIGHT ? MAX_FRAME_HEIGHT : (TMP)); }else{ // Original Code width = finddesireddimensioninrange (screenresolution.x, min_frame_width, > maX_frame_width); height = finddesireddimensioninrange (screenResolution.y, MIN_ Frame_height, max_frame_height); }
The scan box is displayed correctly.
Old Version No
Finddesireddimensioninrange
This method
Plus
private static int Finddesireddimensioninrange (int resolution, int hardmin, int hardMax) {
int Dim = 5 * RESOLUTION/8; Target 5/8 of each dimension
if (Dim < Hardmin) {
return hardmin;
}
if (Dim > HardMax) {
return hardMax;
}
Return Dim;
}
Zxin Android Client Two-dimensional code box problem