在模态中反应本机模糊



我使用react native blur来模糊react natural上的视图,但正如本问题所述,它在模态中不起作用。

我尝试了评论中建议的想法,在imageLoad之后设置一个超时,但它仍然没有模糊。

有什么变通办法吗?为什么它在模态之外工作而在模态中不工作?在react native中模态渲染的方式有什么区别?不幸的是,这是我应用程序中的一个错误部分,我必须成功。

感谢

编辑:我的做法不同。由于blurRadius正在android上以模式处理图像,我使用图像组合来显示我想要的图像。

也许对其他人有用,我尝试了react原生模糊解决方案,但也遇到了问题。最终,这对我来说很好:

<Modal
animationType={'fade'}
transparent={true}
visible={this.state.modalVisible}
onRequestClose={() => {
this.setState({ modalVisible: false });
}}
>
<View
style={{
position: 'absolute',
width: '100%',
height: '100%',
justifyContent: 'center',
backgroundColor: 'rgba(100,100,100, 0.5)',
padding: 20,
}}
>
{this.props.modalContent}
</View>
</Modal>

代码的其余部分可以在react原生模态的文档中找到:https://facebook.github.io/react-native/docs/modal

相关内容

最新更新