ZXing生成的一维条码可以显示数字吗?
我目前在 Android 应用程序中使用 ZXing 来生成一维条形码(EAN_13 和 CODE_39)。 结果看起来不错,但我想在条形码下方显示数字,如下所示:
是否可行?
I'm currently using ZXing in my Android app to generate a one-dimension barcode (EAN_13 and CODE_39).
The result is looking good but I'd like to display numbers below the barcode, like that:
Is it doable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需添加一个在 xzing 条形码下方对齐的 TextView,然后将数字放入其中即可。
如果您确实关心特定的外观(数字在条形码内部稍微对齐) - 您可以为 TextView 设置白色背景,并使用负对齐将其稍微向上移动到条形码中。
不知道xzing是否支持你想要的答案。祝你好运。
You could simply just add a TextView aligned below|center of the xzing barcode, and put the numbers in there.
If you really care about the specific look (with the numbers aligned slightly inside the barcode) - you could set a white background to the TextView, and use a negative alignment to move it up slightly into the barcode.
Don't know answer if xzing supports what you want. Good Luck.