Table of contents
Swift
Objective-C

Configure the UI Elements

Available Buttons
Torch button
Camera toggle button
Close button (BarcodeScanner API only)

BarcodeScanner provides a set of UI elements that you can easily customize.

buttons

buttons

  • Torch button: A clickable button that turns the torch on or off.
  • Camera toggle button: A clickable button that switches the front/back-facing camera.
  • Close button: Stops barcode scanning and returns to the previous activity.
  • Java
  • Kotlin
  1. CameraView cameraView = findViewById(R.id.camera_view);
    cameraView.setTorchButtonVisible(true);
    cameraView.setCameraToggleButtonVisible(true);
    
  2. val cameraView = findViewById<CameraView>(R.id.camera_view)
    cameraView.torchButtonVisible = true
    cameraView.cameraToggleButtonVisible = true
    

Related APIs

This page is compatible for: