github地址: https://github.com/SrBrahma/react-native-shadow-2
安装:
yarn add react-native-svg react-native-shadow-2
使用:
import { Shadow } from 'react-native-shadow-2'; <Shadow> <Text style={{ margin: 20, fontSize: 20 }}></Text> </Shadow>
场景2:
<Shadow distance={15} startColor={'#eb9066d8'} endColor={'#ff00ff10'} offset={[3, 4]}> <View style={{ borderTopStartRadius: 24, borderBottomEndRadius: 0, borderRadius: 10, backgroundColor: '#c454f0dd' }}> <Text style={{ margin: 20, fontSize: 20 }}></Text> </View> </Shadow>