RN基礎知識-佈局
- 使用FlexBox佈局
- 主軸方向:flexDirection: row/row-reverse/cloumn/cloumn-reverse (react-native的話默認以列排列)
- 是否換行:flexWrap: nowrap/wrap/wrap-reverse(默認不換行)
- wrap換行以後第一行在上面
- wrap-reverse換行以後第一行在下面
- 順着主軸的對齊方式:justifyContent: flex-start/flex-end/center/space-between/space-around (默認爲flex-start)
![](http://static.javashuo.com/static/loading.gif)
- 順着側軸的對其方式:alignItems:flex-start | flex-end | center | baseline | stretch;
![](http://static.javashuo.com/static/loading.gif)
- 尺寸沒有單位,表明與設備無關的獨立像素:android解釋爲dp,ios上爲sp
- 一些邊距,都爲不帶單位的num
- 外邊距:margin | marginLeft | marginRight | marginTop | marginBottom
- 內邊距:padding | paddingLeft | paddingRight | paddingTop | paddingBottom
- 邊緣:left | right | top | bottom
歡迎關注本站公眾號,獲取更多信息