Created
July 26, 2018 06:07
-
-
Save manas-raj-shrestha/248fa424dc8147f6c4d3ac10df626580 to your computer and use it in GitHub Desktop.
React Native Shadow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {StyleSheet, Text, View, Image } from 'react-native'; | |
import {BoxShadow, BorderShadow} from 'react-native-shadow' | |
import Svg,{ | |
Circle, | |
Ellipse, | |
G, | |
LinearGradient, | |
RadialGradient, | |
Line, | |
Path, | |
Polygon, | |
Polyline, | |
Rect, | |
Symbol, | |
Use, | |
Defs, | |
Stop | |
} from 'react-native-svg'; | |
export default class App extends React.Component { | |
render() { | |
const shadowOpt = { | |
width:86, | |
height:86, | |
color:"#000000", | |
border:10, | |
x:8, | |
y:8, | |
opacity:0.5, | |
radius:43, | |
} | |
return ( | |
<View key={"3"} style={{paddingTop:100}}> | |
<BoxShadow setting={shadowOpt}> | |
<Svg key={"1"} | |
height="100" | |
width="100" | |
> | |
<Circle key={"2"} | |
cx="50" | |
cy="50" | |
r="45" | |
stroke="blue" | |
strokeWidth="2.5" | |
fill="green" | |
/> | |
</Svg> | |
</BoxShadow> | |
</View> | |
); | |
/* <View style={{width:100,height:100, backgroundColor:"#800000",elevation: 10, */ | |
// overflow: "visible", | |
// shadowOffset: { width: 10, height: 10 }, | |
// shadowColor: 'black', | |
// shadowOpacity: 1, | |
// elevation: 20, | |
// zIndex:999 | |
// }}/> | |
/* <BorderShadow key={"4"} setting={shadowOpt}> */ | |
/* <Svg key={"1"} | |
height="100" | |
width="100" | |
> | |
<Circle key={"2"} | |
cx="50" | |
cy="50" | |
r="45" | |
stroke="blue" | |
strokeWidth="2.5" | |
fill="green" | |
/> | |
</Svg> */ | |
/* </BorderShadow> */ | |
/* <Image | |
source={require('./testimg.png')}/> */ | |
// | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#fff', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment