加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react-native – React Native – 如何进行模糊视图,如iOS或Inst

发布时间:2020-12-15 16:21:32 所属栏目:百科 来源:网络整理
导读:背景透明度与BLUR 是否可以在不使用背景图像的情况下模糊视图?我想在模态中的背景模糊视图上显示父内容. 类似的这种: 试过react-native-blur: 它实际上模糊了背景图像.我想模糊并显示模态背后的内容. 与react-native-overlay一起尝试:但没有变化. 解决方
背景透明度与BLUR

是否可以在不使用背景图像的情况下模糊视图?我想在模态中的背景模糊视图上显示父内容.

类似的这种:

试过react-native-blur:

它实际上模糊了背景图像.我想模糊并显示模态背后的内容.

与react-native-overlay一起尝试:但没有变化.

解决方法

好吧,如果你是

using expo

那么你应该去看看这个链接here

如果你像我一样

who loves to use ‘react-native init‘ and want some blurry effect based views then i have this for you!

https://github.com/voronianski/react-native-effects-view

一个很棒的图书馆

使用它会很简单

“如果对话框打开,则呈现模糊视图,否则渲染简单”,

这里有一个基本如何使用的简单示例!

...imports
var EffectsView = require('react-native-effects-view');

var App = React.createClass({
renderVibrant() {
    return (
        <View>
            <Text style={styles.text}>Do you feel blurry??</Text>
        </View>
    );
},render() {
    return (
        <EffectsView 
            style={styles.view} 
            blurStyle="dark" 
            vibrantContent={this.renderVibrant()}
        >
            <Image style={styles.bg} source={require('image!bg')} />
        </EffectsView>
    );
}
});

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读