android – 如何为qr代码扫描器绘制四个边界角

android – 如何为qr代码扫描器绘制四个边界角,第1张

概述如何为qrcode绘制四个边界? 我为此创建了一个矢量drawable: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="220dp" android:height="220dp" android:viewportHeight="230.0" android:vie

如何为qrcode绘制四个边界?

解决方法 我为此创建了一个矢量drawable:
<vector     xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:wIDth="220dp" androID:height="220dp" androID:vIEwportHeight="230.0" androID:vIEwportWIDth="230.0">    <path androID:fillcolor="#00000000" androID:fillType="evenOdd"        androID:pathData="M165,5C178.2,5 198.2,5 225,5L225,30.79L225,65"        androID:strokecolor="@color/qr_code_reader_square" androID:strokeWIDth="10"/>    <path androID:fillcolor="#00000000" androID:fillType="evenOdd"        androID:pathData="M5,65C5,51.8 5,31.8 5,5L30.79,5L65,5"        androID:strokecolor="@color/qr_code_reader_square" androID:strokeWIDth="10"/>    <path androID:fillcolor="#00000000" androID:fillType="evenOdd"        androID:pathData="M165,225C178.2,225 198.2,225 225,225L225,199.21L225,165"        androID:strokecolor="@color/qr_code_reader_square" androID:strokeWIDth="10"/>    <path androID:fillcolor="#00000000" androID:fillType="evenOdd"        androID:pathData="M5,165C5,178.2 5,198.2 5,225L30.79,225L65,225"        androID:strokecolor="@color/qr_code_reader_square" androID:strokeWIDth="10"/></vector>

您可以将其保存在res / drawable中作为qr_code_reader_square.xml,然后在您的布局中使用它,如下所示:

<FrameLayout    androID:layout_wIDth="250dp"    androID:layout_height="250dp"    androID:background="@drawable/qr_code_reader_square"/>

您还必须在res / values / colors.xml中设置颜色:

<color name="qr_code_reader_square">#FFFFFFFF</color>
总结

以上是内存溢出为你收集整理的android – 如何为qr代码扫描器绘制四个边界角全部内容,希望文章能够帮你解决android – 如何为qr代码扫描器绘制四个边界角所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1148876.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存