react-native-qrcode icon indicating copy to clipboard operation
react-native-qrcode copied to clipboard

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

Open tkulpa opened this issue 6 years ago • 19 comments

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) => ( <View style={styles.container}> <View style={styles.wrapper}>{props.children}</View> </View> )

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

tkulpa avatar Dec 17 '18 21:12 tkulpa

Same issue here

obetomuniz avatar Dec 18 '18 19:12 obetomuniz

Same issue here

heimi-block avatar Dec 28 '18 04:12 heimi-block

Same issue here

Only in Andriod

heimi-block avatar Dec 28 '18 04:12 heimi-block

same issue. Any new update for this?

devvuphan avatar Dec 31 '18 07:12 devvuphan

same issue here

eladglobalbit avatar Dec 31 '18 08:12 eladglobalbit

Same issue

Jobel91 avatar Jan 18 '19 15:01 Jobel91

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 avatar Jan 19 '19 15:01 AGFarhat

@AGFarhat it works. Thanks!

sertony avatar Jan 23 '19 14:01 sertony

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

mroozspace avatar Jan 25 '19 12:01 mroozspace

Thanks to @AGFarhat. It works !

Jobel91 avatar Jan 31 '19 13:01 Jobel91

@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!

todorone avatar Feb 04 '19 12:02 todorone

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

Jobel91 avatar Feb 04 '19 12:02 Jobel91

@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)

AGFarhat avatar Feb 05 '19 16:02 AGFarhat

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?

JherysVargas avatar Feb 19 '19 14:02 JherysVargas

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.

m3dwards avatar Mar 27 '19 18:03 m3dwards

@AGFarhat it's work for me, many thanks

dvhai avatar Apr 08 '19 10:04 dvhai

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

ghost avatar Jun 27 '19 08:06 ghost

same issue and it's work,very thanks

lyy199212 avatar Sep 03 '19 04:09 lyy199212

@AGFarhat It Worked, Thanks :)

Harshbhama avatar Dec 06 '19 10:12 Harshbhama