美文网首页
三 Width and Height

三 Width and Height

作者: falcon_li | 来源:发表于2018-01-03 15:07 被阅读0次

1.在 style 属性中设置 width 和 height 确定组件的大小;

例:

<View style={{width:100,height:100.backgroundColor:'red'}} />

2.使用 flex 控制组件在空间中收缩;

注意:父组件必须设置了 witdh height 获取 flex ,子组件的 flex 设置才会生效;

相关文章

网友评论

      本文标题:三 Width and Height

      本文链接:https://www.haomeiwen.com/subject/gtbhnxtx.html