eveation 是Android 平台都有的样式键,它是数值类型的样式键,通过在组件的周围渲染阴影效果,让用户产生组件浮现在手机上的效果。
import React,{ Component } from 'react'; import { AppRegistry,StyleSheet,Text,View } from 'react-native'; export default class ViewProject extends Component { render() { return ( <View style={styles.container}> <View style={styles.block} /> <View style={styles.block1} /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1,justifyContent:"space-around",alignItems:"center",backgroundColor:"white",},block:{ width:150,height:150,borderWidth:1,backgroundColor:"black",borderRadius:25,block1:{ width:150,elevation:100 },}); AppRegistry.registerComponent('ViewProject',() => ViewProject);