Open exoriri opened 1 year ago
I faced with same issue. Just use position: absolute
for children element and don't put something inside
I faced with same issue. Just use
position: absolute
for children element and don't put something inside .
Thanks. Spent a lot of time figuring out how to make it works.
@exoriri you can try with this
` const [displayChildren, setDisplayChildren] = React.useState(false);
React.useEffect(() => {
setTimeout(() => {
setDisplayChildren(true);
}, 0);
}, []);`
and use that var to display children. It will work as long as you don't open keyboard.
@lpatrun thanks for the reply. I think this solution looks a bit better https://github.com/Kureev/react-native-blur/issues/483#issuecomment-1199210714
As another workaround:
{/* This looks stupid, but blur-view on android is broken
Elements placed inside do not position correctly
The work around is two overlays
*/}
{store.ui.isLoading && (
<BlurView
blurType="dark"
blurAmount={10}
reducedTransparencyFallbackColor="black"
style={tw`absolute inset-0`}
/>
)}
{store.ui.isLoading && (
<View style={tw`absolute inset-0 items-center`}>
<View className="flex-1" />
<ActivityIndicator color="white" size="large" />
<T style={tw`mt-6 text-white`}>{t`pleaseWait`}</T>
<View className="flex-1" />
<ABLLogoWhite className="h-12 w-12 mb-12" height={30} width={40} />
</View>
)}
To fix this bug, for me worked to have some background color, e.g. backgroundColor: 'transparent'
for the direct Blurview child so that items inside are positioned correctly.
<BlurView>
<View style={{backgroundColor: 'transparent'}}>
{children}
</View>
</BlurView
To fix this bug, for me worked to have some background color, e.g.
backgroundColor: 'transparent'
for the direct Blurview child so that items inside are positioned correctly.<BlurView> <View style={{backgroundColor: 'transparent'}}> {children} </View> </BlurView
thanks man. works like a charm!
DESCRIPTION
I use your library and I like it. It works on iOS devices fine. But on Android, elements wrapped in
<BlurView>{children}</BlurView
run into each other. Sometimes when I change something in styles in dev mode, it works correctly, but when I build apk, bug appears again.How can I fix it on Android? Thanks in advance. Code I use with
BlurView
attached below.SCREENSHOT
PLATFORM
CODE