React-Native基础_2.样式Style

2.样式Style
基本使用
方式1 直接在View 上面写style 内容
       <View style={{
                backgroundColor: '#07811d',flex: 1
            }}>
                <Text>
                    Welcome to React Native!
                </Text>
            </View>
方式2 StyleSheet.create定义一个style 常量,然后直接使用常量中定义好的属性
export default class Day0718 extends Component {

    render() {
        return (
            <View style={styles.Container}>
                <Text style={styles.Text}>
                    Welcome to React Native!
                </Text>
            </View>
        );
    }
}
const styles = StyleSheet.create({
    Container :{
        borderWidth :1,borderColor:'#c9382d',borderRadius:15,shadowColor:'#6435c9',shadowOpacity:0.6,shadowRadius:2,shadowOffset:{
            height:1,width:0,},margin:10,backgroundColor: '#c9382d',flex: 1,Text:{
        color:'#6435c9',fontSize: 26,textAlign:'center',fontStyle:'italic',letterSpacing:2,lineHeight:33,fontFamily:'Helvetica Neue',fontWeight:'300',textdecorationLine:'underline',textdecorationStyle:'dashed',});


---------------欢迎各位大神加群

----------------Android交流群:230274309

-----------------------------期待大神们的到来

------------------------一---起分享,一起进步!需要你们

相关文章

react 中的高阶组件主要是对于 hooks 之前的类组件来说的,如...
我们上一节了解了组件的更新机制,但是只是停留在表层上,例...
我们上一节了解了 react 的虚拟 dom 的格式,如何把虚拟 dom...
react 本身提供了克隆组件的方法,但是平时开发中可能很少使...
mobx 是一个简单可扩展的状态管理库,中文官网链接。小编在接...
我们在平常的开发中不可避免的会有很多列表渲染逻辑,在 pc ...