如何使Android Studio中的Camera Source变为圆形或圆形?

时间:2019-07-14 08:50:48

标签: android android-studio android-layout

嗨,我有一个扫描一些QR码的项目,我已经成功完成了。但是我有一个问题,使照相机变成圆形,以便用户只能将照相机聚焦为QR码。 这是我的XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".BarcodeScanner.BarcodeScannerActivity">

    <com.example.hashvoucherscanner.BarCodeScannerUtil.common.CameraSourcePreview
        android:id="@+id/preview"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.example.hashvoucherscanner.BarCodeScannerUtil.common.GraphicOverlay
            android:id="@+id/barcodeOverlay"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </com.example.hashvoucherscanner.BarCodeScannerUtil.common.CameraSourcePreview>


</RelativeLayout>

我该如何实现?

0 个答案:

没有答案