我正在使用带有Modal的react-native-blur来创建模糊的背景。在Ios上一切似乎都工作正常,但是当Android后台有摄像头预览时,模糊效果并没有被应用
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}
radius={14}
downsampling={2}
brightness={-200}
blurStyle='dark'
>
<BlurView
blurAmount={100}
blurType={'light'}
style={styles.blurStyles}
blurRadius={25}
downsampleFactor={25}
{...blurProps}
/>
{children}
</Modal>
)
}