React Native 之 Text 文字添加阴影效果
发布时间:2020-12-15 07:27:30 所属栏目:百科 来源:网络整理
导读:/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React,{ Component } from 'react';import { AppRegistry,StyleSheet,Image,Text,TouchableHighlight,View} from 'react-native';export default class ViewPro
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React,{ Component } from 'react'; import { AppRegistry,StyleSheet,Image,Text,TouchableHighlight,View } from 'react-native'; export default class ViewProject extends Component { render() { return ( <View style={styles.container}> <Text style={styles.baseStyle}> 我是60号字体 <Text style={{fontWeight:'800'}}> {'rn'}我是加粗60号字体 </Text> </Text> </View> ); } } const styles = StyleSheet.create({ container: { flex:1,justifyContent: 'center',alignItems:'center',backgroundColor:'white',},baseStyle:{ fontSize:60,textAlign:'center',color:'black',textShadowOffset:{width:5,hegith:5},textShadowRadius:2,textShadowColor:'grey' } }); AppRegistry.registerComponent('ViewProject',() => ViewProject); 定义阴影效果相关的三个样式键 textShadowOffset textShadowRadius textShadowColor (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |