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

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

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值