Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camera view, fullscreen not working #12

Open
joaoalbertocsjunior opened this issue Dec 10, 2017 · 3 comments
Open

camera view, fullscreen not working #12

joaoalbertocsjunior opened this issue Dec 10, 2017 · 3 comments

Comments

@joaoalbertocsjunior
Copy link

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.);
}}
/>

);
}
}

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

What could this be related to?

@romanenko
Copy link

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}
  />
)

@cesarm16
Copy link

cesarm16 commented Jul 2, 2018

i've the same problem, any solution?

@ananth10
Copy link

ananth10 commented Oct 8, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants