style的一些不常见的属性

1、要画一个如图所示的虚线

style={{

width:100,
height:100,
justifyContent:"center",
alignItems:"center",
borderWidth:1, marginTop:10,
borderRadius:5,
borderColor:"red",
borderStyle:"dashed"

}}

2、画一个如图所示的三角

triangle:{
width:0,
height:0,
borderTopWidth:100,
borderTopColor:"red",
borderRightWidth:100,
borderRightColor:"transparent"
},

画一个正三角

<View style={{width: 0,
            height: 0,
            borderLeftWidth: 5,
            borderLeftColor:"transparent",
            borderRightWidth: 5,
            borderRightColor:"transparent",
            borderBottomWidth: 10,
            borderBottomColor:"red"}}>
          </View>

  倒三角

<View style={{width: 0,
            height: 0,
            borderLeftWidth: 5,
            borderLeftColor:"transparent",
            borderRightWidth: 5,
            borderRightColor:"transparent",
            borderTopWidth: 10,
            borderTopColor:"red"}}>
          </View>

  

 

3、justifyContent用来指定水平方向上布局排版除"center","flex-satrt","flex-end"外还有两个值"space-between"

"space-around"。

space-between,这个可以让子元素被平均分布,第一子元素在容器最左边,最后一个子元素在最右边.

space-around可以让一列子元素均匀分布。

4、让view旋转180度

transform:[{rotate: '180deg'}]

示例

  <Text style={{fontSize:14,color:"#b0b0b0",transform:[{rotate: '180deg'}] }}>扫我查看更多</Text>
           

 

转载于:https://www.cnblogs.com/lgp142332/p/7513440.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值