//3.style样式
import React,{useState} from 'react';
import {Text,StyleSheet,View} from 'react-native';
const StyleDemo=()=>{
return(
<View style={myStyles.container}>
<Text style={myStyles.background}>hello background</Text>
<Text style={myStyles.red}>hello red</Text>
<Text style={myStyles.background}>hello background</Text>
</View>
);
}
const myStyles=StyleSheet.create(
{
container:{
marginTop:50,
},
background:{
backgroundColor:'green',
color:'blue',
fontSize:30
},
red:{
color:'red'
}
}
);
export default StyleDemo;
React-native学习-3-style样式
最新推荐文章于 2024-09-12 12:18:02 发布