如何在React Native中为视图添加模糊,就像我们为图像或背景图像添加模糊一样?如果使用RGBA时视图有半透明背景,我也想为它添加模糊。
样本代码
<ImageBackground style={styles.bg}>
<View style={styles.content} />
</ImageBackground>
const styles = StyleSheet.create({
bg: {
width: "100%",
height: "100%"
},
content:{
width: "70%",
height: "70%",
backgroundColor: "rgba(255,255,355,0.4)",
alignSelf: "center"
}
})
2条答案
按热度按时间lzfw57am1#
最简单的方法是执行以下操作:
mspsb9vt2#
您可以使用不透明度