question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Should add a props to fix the issue on failing to change camera size

See original GitHub issue

Like many other issues mentioned, the size of camera is unable to be changed in some SDK version (not sure which versions are them, it worked fine on 26 but broken on 28 in my case).

After I added a ratio manually like below I can resize the camera into square again

<Camera
    ratio={"1:1"}  //add this line manually to avoid the camera being resized into 4:3 by default
    style={[styles.camera, this.props.cameraStyle]} 
    onBarCodeRead={this._handleBarCodeRead.bind(this)}
    type={this.props.cameraType}
>

So perhaps it would be helpful to have a [props.cameraRatio] in the future to deal with the resizing of camera. Just like:

<Camera
    ratio={this.props.cameraRatio} 
    style={[styles.camera, this.props.cameraStyle]} 
    onBarCodeRead={this._handleBarCodeRead.bind(this)}
    type={this.props.cameraType}
>

P.S I really appreciate you guys made this package, our team use it in our project(called tico), it’s really helpful and easy to be implemented. Good job and thank you 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

29reactions
Valentinishecommented, Jun 27, 2019

https://github.com/moaazsidat/react-native-qrcode-scanner/issues/182 cameraStyle={{overflow: 'hidden'}} - it helped me

8reactions
jtarinicommented, Mar 8, 2019

@howieyoung I faced the same issue and fixed just adding cameraProps={{ratio: "1:1"}}

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Tweaks][Guide]Build.prop Tweaks | XDA Forums
The thing is that if you are having any rooted Android device. So this tweak will work absolutely fine. Every user can do...
Read more >
Configuration options | Android Developers
Although CameraX creates and manages the session, you should always check the returned image sizes on the use case output in your code...
Read more >
RNCamera · React Native Camera
For Android, this prop attempts to control the camera sensor capture resolution, similar to how ratio behaves.
Read more >
Using React Native Camera in your app - FullStack Labs
And we need to set up permissions for both Android and iOS. ... In the case of iOS we just need to edit...
Read more >
React Native - How to make image width 100 percent and ...
So, my question is what is the best way to deal with this situation? Do I have to manually put width, height size...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found