TommyLemon / Android-ZBLibrary

🔥 Android MVP 快速开发框架,做国内 「示例最全面」「注释最详细」「使用最简单」「代码最严谨」的 Android 开源 UI 框架。 🔥 An Android MVP Framework with many demos, detailed documents, simple usages and strict codes.
Apache License 2.0
5.5k stars 1.38k forks source link

非全屏下怎么设置zxing透明背景预览(应该是surfaceview)位置和大小,设置完扫码变形了 #16

Closed iamzj closed 6 years ago

iamzj commented 6 years ago

tim 20180102110554

TommyLemon commented 6 years ago

透明背景确实是用SurfaceView实现的,SurfaceView的宽高比决定了画面的宽高比。 所以要想不拉伸,需要设置它的width=height。ZBLibrary已更新,已经看不出拉伸了。

还有一个ViewfinderView用于显示中间的定位框,并在解析的时候有点阵提示。 ViewfinderView不能指定宽高,否则扫描读取成功率会很低。