【发布时间】:2019-04-20 10:28:45
【问题描述】:
我正在使用 React-Native 开发一个移动应用程序,我需要实现一个新组件。
例子:
所以,我的问题是,如何在我的组件上添加这个阴影/模糊图像?
我知道如何在图像上进行模糊处理,但我该如何做呢?
谢谢
【问题讨论】:
标签: image react-native shadow blur
我正在使用 React-Native 开发一个移动应用程序,我需要实现一个新组件。
例子:
所以,我的问题是,如何在我的组件上添加这个阴影/模糊图像?
我知道如何在图像上进行模糊处理,但我该如何做呢?
谢谢
【问题讨论】:
标签: image react-native shadow blur
所以,基本上你使用两个图像,不透明度、模糊半径和绝对位置。
试试:
<View style={{elevation:12, position:'absolute', left:100, top:100, elevation:12, borderRadius:50, borderWidth: 1, borderColor:'rgba(255, 255, 2555, 0.4)', overflow: 'hidden', opacity:0.3}}>
<Image blurRadius={10} style={{width:300, height:150}} source={{uri:'https://image.shutterstock.com/image-photo/beautiful-garden-flowers-450w-257560639.jpg'}} />
</View>
<View style={{position:'absolute', left:95, top:90, borderRadius:50, borderWidth: 0, borderColor:'rgba(255, 255, 2555, 0.4)', overflow: 'hidden'}}>
<Image style={{width:300, height:150, }} source={{uri:'https://image.shutterstock.com/image-photo/beautiful-garden-flowers-450w-257560639.jpg'}} />
</View>
【讨论】:
react-native-blur 一起工作的?我没有好结果。请给我一个代码sn-p好吗?