【发布时间】:2020-10-06 05:37:19
【问题描述】:
我正在尝试使用 react native shadow 重新创建下面的图像。 如您所见,有了阴影,图像对象似乎位于白色架子的顶部。
这是我的尝试。但我的努力不够短,因为顶部阴影更像是黑点,而不是像上面的渐变。有什么建议吗?谢谢!
const CollectionScreen = () => {
return (
<View>
<View style={{ backgroundColor: 'black', width: 100, height: 100, position: 'absolute', top: 100, left: 100}}/>
<View style = {styles.shelf}/>
</View>
);
}
const styles = StyleSheet.create({
shelf: {
width: 1242,
height: 25,
borderRadius: 5,
backgroundColor: 'white',
position: 'absolute',
top: 200,
shadowColor: "#000",
shadowOffset: {
width: 3,
height: -5,
},
shadowOpacity: 0.25,
shadowRadius: 10,
marginTop: 3
}
})
【问题讨论】:
标签: ios react-native shadow