react-native-barcode-scanner-google icon indicating copy to clipboard operation
react-native-barcode-scanner-google copied to clipboard

camera view, fullscreen not working

Open joaoalbertocsjunior opened this issue 7 years ago • 3 comments

Hi! I'am following the example on the readme section, and camera doesnt seem to get fullscreen on physical device, even with style flex: 1.

Here is the code:

import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, Alert } from 'react-native'; import BarcodeScanner from 'react-native-barcode-scanner-google';

export default class BarcodeApp extends Component { render() { return ( <View style={{ flex: 1 }}> <BarcodeScanner style={{ flex: 1, }} onBarcodeRead={({data, type}) => { // handle your scanned barcodes here! // as an example, we show an alert: Alert.alert(Barcode '${data}' of type '${type}' was scanned.); }} /> </View> ); } }

AppRegistry.registerComponent('brcodegooglern', () => BarcodeApp);

What could this be related to?

joaoalbertocsjunior avatar Dec 10 '17 14:12 joaoalbertocsjunior

Thanks for the great lib, @ekreutz.

I have this issue in my emulator too. I'm running a virtual device in my AVD: 720x1280. API 22. Android 5.1. x86.

This is what I see using cameraFillMode={CameraFillMode.COVER}

image

And this is what it looks like with cameraFillMode={CameraFillMode.FIT}

image

I pass dimensions of the window to the style props like this:

const { width, height } = Dimensions.get('window');

return (
  <BarcodeScanner
    style={{ width, height }}
    onException={this.handleException}
    onBarCodeRead={this.handleBarcodeRead}
    cameraFillMode={CameraFillMode.COVER}
    barcodeType={BarcodeType.EAN_13}
  />
)

romanenko avatar Dec 12 '17 03:12 romanenko

i've the same problem, any solution?

cesarm16 avatar Jul 02 '18 17:07 cesarm16

Hello guys, the camera view fits in mobiles but its not fully fit in some tablet. any solution?

ananth10 avatar Oct 08 '18 08:10 ananth10