Kureev / react-native-blur

React Native Blur component
MIT License
3.75k stars 556 forks source link

Blur not working over React Native Camera in Android #379

Open gigarthan opened 4 years ago

gigarthan commented 4 years ago

Question: I'm using react-native-blur with Modal to create a blurred background. Everything seems to be working fine in Ios but the blur is not getting applied over when there is a camera preview in the background in Android

Android

Ios

Code for the modal with blur

const styles = StyleSheet.create({
  modalStyle: {backgroundColor: 'transparent'},
  blurStyles: {
    position: 'absolute',
    top: 0,
    bottom: 0,
    left: 0,
    right: 0,
  },
});

export default function BlurredModal({children, modalProps, blurProps}) {
  return (
    <Modal
      animationType={'fade'}
      transparent={true}
      customStyle={styles.modalStyle}
      {...modalProps} >
      <BlurView
        blurAmount={100}
        blurType={'light'}
        style={styles.blurStyles}
        blurRadius={25}
        downsampleFactor={25}
        {...blurProps}
      />
      {children}
    </Modal>
  );
}
pke commented 4 years ago

It's not working over any view. The lib for Android is broken atm.

jasulan1101 commented 4 years ago

+

scottlet commented 4 years ago

It's not working over any view. The lib for Android is broken atm.

Is this still the case? Also having a similar issue (using dark blur on a BlurView set to 20% high at the bottom of the screen, if I don't put it in a view with overflow:hidden then it darkens the entire screen as well as the 20% high area which is supposed to be blurred is just black).

Or do I have a different issue? Works fine on iOS.

prakashkrsingh0 commented 2 years ago

I'm also having the same issue with android. With ios, I'm able to do. Screenshot 2021-10-04 at 4 46 51 PM

labmorales commented 1 year ago

Same here.

iOS File

Android Screenshot_20230811_111721_Cosm

I'm using it like this:

<BlurView
          blurAmount={10}
          style={tw(`absolute inset-0 z-10`)}
        />