Balakumaran
Balakumaran

Reputation: 63

Box shadow button in react native

**enter image description here**

I need like that button in react native ..it's possible??

I need to set press animation after clicking button like in below url..

https://www.w3schools.com/css/tryit.asp?filename=trycss_buttons_animate3

Upvotes: 0

Views: 3528

Answers (1)

Saurabh Joshi
Saurabh Joshi

Reputation: 267

You have to give elevation prop to View

<View elevation={5} style={styles.container}>
    <Text>Hello World !</Text>
</View>

styles can be added like this :

const styles = StyleSheet.create({

 container:{
    padding:20,
    backgroundColor:'#d9d9d9',
    shadowColor: "#000000",
    shadowOpacity: 0.8,
    shadowRadius: 2,
    shadowOffset: {
      height: 1,
      width: 1
    }
   },
 }) 

Upvotes: 1

Related Questions