zxing不會吧,妳把掃描框調整壹下,不要這麽大
這個就是設置掃描框的常量
getFramingRect 方法建議妳改壹下
?/***?Calculates?the?framing?rect?which?the?UI?should?draw?to?show?the?user?where?to?place?the
*?barcode.?This?target?helps?with?alignment?as?well?as?forces?the?user?to?hold?the?device
*?far?enough?away?to?ensure?the?image?will?be?in?focus.
*
*?@return?The?rectangle?to?draw?on?screen?in?window?coordinates.
*/
public?Rect?getFramingRect()?{
Point?screenResolution?=?configManager.getScreenResolution();
if?(framingRect?==?null)?{
if?(camera?==?null)?{
return?null;
}
int?width?=?(int)?(screenResolution.x?*?4?/?5);
if?(width?<?MIN_FRAME_WIDTH)?{
width?=?MIN_FRAME_WIDTH;
}
int?height?=?(int)?(screenResolution.y?/?1.5);
int?leftOffset?=?(screenResolution.x?-?width)?/?2;
int?topOffset?=?(screenResolution.y?-?height)?/?2;
framingRect?=?new?Rect(leftOffset,?topOffset,?width?+?leftOffset,?width?+?leftOffset);
Log.d(TAG,?"Calculated?framing?rect:?"?+?framingRect);
}
return?framingRect;
}
這是我的zxing掃描源碼