cssivision / react-native-qrcode

a minimalist qrcode component for react-native
MIT License
853 stars 304 forks source link

[ANDROID] Getting white flash on background while qr code is being generated #68

Open tkulpa opened 5 years ago

tkulpa commented 5 years ago

Ignore ActivityIndicator, I just made sure that flash isn't related to animation

dec-17-2018 22-20-08

My modal that is storing component which is storing qr code: `const Modal = (props: Props) => (

{props.children}

)

const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: 'yellow', //rgba(0,21,43,0.75) alignItems: 'center', justifyContent: 'center', padding: 24, } as ViewStyle, wrapper: { backgroundColor: 'white', padding: 16, paddingTop: 32, alignItems: 'center', justifyContent: 'center', alignSelf: 'stretch', borderTopRightRadius: 24, borderBottomLeftRadius: 24, } as ViewStyle, })

export default Modal`

And Im using react-navigation modal to show this on screen only problem occurs on android emulator, ios is fine

obetomuniz commented 5 years ago

Same issue here

heimi-block commented 5 years ago

Same issue here

heimi-block commented 5 years ago

Same issue here

Only in Andriod

devvuphan commented 5 years ago

same issue. Any new update for this?

eladglobalbit commented 5 years ago

same issue here

Jobel91 commented 5 years ago

Same issue

AGFarhat commented 5 years ago

I had the same issue, fixed it with a little 'hack'. Add a view component around your QR code and apply overflow:'hidden' style to it. Let me know if that works for you too

sertony commented 5 years ago

@AGFarhat it works. Thanks!

mroozspace commented 5 years ago

I had similar issue. Component was packed in Scrollview and on generating qr code, whole screen flckered. Solution was packing qrcode in another scrollview inside parent

Jobel91 commented 5 years ago

Thanks to @AGFarhat. It works !

todorone commented 5 years ago

@AGFarhat @sertony @mroozspace @Jobel91 Followed advised pattern and have working QR code on iOS and on Android simulator, but when published, on real Android device I have blank WebView(scrollbars that being hidden within couple seconds). I have React Native 0.57. Can you please report RN version and confirm that hacks works on real Android device. Thanks!

Jobel91 commented 5 years ago

@todorone , it works on Android real device, React Native version : 0.57.1

AGFarhat commented 5 years ago

@AGFarhat @sertony @mroozspace @Jobel91 Followed advised pattern and have working QR code on iOS and on Android simulator, but when published, on real Android device I have blank WebView(scrollbars that being hidden within couple seconds). I have React Native 0.57. Can you please report RN version and confirm that hacks works on real Android device. Thanks!

Yea i got that randomly one day... its weird. Anyways i think i found a fix that works for me. Basically make sure that for props bgColor and fgColor you insert either in the form 'black' or 'white' or as 'rgb(xxx,xxx,xxx)'. try it (y)

JherysVargas commented 5 years ago

Ignore ActivityIndicator, I just made sure that flash isn't related to animation

dec-17-2018 22-20-08

My modal that is storing component which is storing qr code: `const Modal = (props: Props) => (

{props.children}

)

const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: 'yellow', //rgba(0,21,43,0.75) alignItems: 'center', justifyContent: 'center', padding: 24, } as ViewStyle, wrapper: { backgroundColor: 'white', padding: 16, paddingTop: 32, alignItems: 'center', justifyContent: 'center', alignSelf: 'stretch', borderTopRightRadius: 24, borderBottomLeftRadius: 24, } as ViewStyle, })

export default Modal`

And Im using react-navigation modal to show this on screen only problem occurs on android emulator, ios is fine

How do you show the ActivityIndicator while the QR is generated?

m3dwards commented 5 years ago

For me, when the QR code is rendered it makes invisible any TextInputs. Using Expo API version 32.

I was able to take the sample code on the README of this project and replicate the issue on two android devices as the sample code includes a TextInput. It's a bit intermittent, sometimes they show and you can click on them and enter text even though you can see them and then sometimes they show after entering text.

Putting the QRCode inside a ScrollView with overflow hidden solved the problem for me so thanks for those who offered that solution to the flicker. I'd raise a specific issue but as the same solution fixed the problem for me, I suspect this might be the same bug.

dvhai commented 5 years ago

@AGFarhat it's work for me, many thanks

ghost commented 5 years ago

I had the same issue, fixed it with a little 'hack'. Add a view component around your QR code and apply overflow:'hidden' style to it. Let me know if that works for you too

@AGFarhat it's work, thank much

lyy199212 commented 4 years ago

same issue and it's work,very thanks

Harshbhama commented 4 years ago

@AGFarhat It Worked, Thanks :)