react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

react native camera kit is not covering full screen

Open nehaasaxena opened this issue 6 years ago • 6 comments

Issue Description

In my application I'm using react-native-camera-kit it has header and footer space as black for iOS. I want camera to cover the whole screen.

IMG_3221

Steps to Reproduce / Code Snippets / Screenshots

   <CameraKitCameraScreen
      ref={(cam) => (this.camera = cam)}
      onBottomButtonPressed={(event) => this.onBottomButtonPressed(event)}
      captureButtonImage={images.photoCapture}
      showFrame={true}
      heightForScannerFrame={height}
      offsetForScannerFrame={offset}
      scanBarcode={true}
      laserColor={'white'}
      frameColor={'white'}
      colorForScannerFrame={'white'}
      cameraOptions={{
        flashMode: turnOnFlash ? 'on' : 'off',
      }}
      onReadCode={(event) =>
        this.onBarcodeScan(event.nativeEvent.codeStringValue)
      }
    />

Environment

  • React Native Navigation version: 3.11.0
  • React Native version: 0.59.5
  • Platform(s) (iOS, Android, or both?): both
  • Device info (Simulator/Device? OS version? Debug/Release?): all iOS devices

nehaasaxena avatar Mar 19 '20 04:03 nehaasaxena

Have you try to do it without the showFrame={true} ?

gran33 avatar Mar 19 '20 11:03 gran33

Have you try to do it without the showFrame={true} ?

Hello @gran33

Yes I've tried that as well but didn't work.

nehaasaxena avatar Mar 19 '20 15:03 nehaasaxena

Any updates on this? :)

thatgriffith avatar May 19 '20 10:05 thatgriffith

Did anyone accomplish this? I can't find a way to make it work :(

sanders-vag avatar Jun 30 '20 09:06 sanders-vag

@sanders-vag

My problem was that I had not set flex: 1. Now, my component looks like this:

    <View style={{ flex: 1 }}>
        <CameraKitCameraScreen
          style={{ flex: 1 }}
          scanBarcode={true}
          hideControls={true}
          onReadCode={onBarcodeScan}
          ref={camera}
        />
    </View>

Hope this helps!

thatgriffith avatar Jul 10 '20 08:07 thatgriffith

I have the same the problem, but added this props solve the problem => hideControls

<CameraKitCameraScreen
  ...
  hideControls
  ...
/>

aminhdev avatar Dec 16 '22 04:12 aminhdev