ReactNative给View设置阴影

ReactNative怎么给View设置阴影,安卓端的。
或者,怎么实现这样的一个效果。

阅读 8.4k
2 个回答

目前的RN版本不支持android的阴影属性

新手上路,请多包涵

使用react-native-shadow

import {BoxShadow} from 'react-native-shadow';
const shadowOpt = {
            width:200,
            height:192,
            color:"#D6D2D3",
            border:4,
            radius:4,
            opacity:0.5,
            x:14,
            y:9,
        }
     render(){
        return (
         <BoxShadow setting={shadowOpt}>
                {this.props.children}
         </BoxShadow>
        )
    }

        
        
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题