RN基礎知識-佈局

    1. 使用FlexBox佈局
      1. 主軸方向:flexDirection: row/row-reverse/cloumn/cloumn-reverse (react-native的話默認以列排列)
      2. 是否換行:flexWrap: nowrap/wrap/wrap-reverse(默認不換行) 
        1. wrap換行以後第一行在上面
        2. wrap-reverse換行以後第一行在下面
      3. 順着主軸的對齊方式:justifyContent: flex-start/flex-end/center/space-between/space-around (默認爲flex-start) 

      4. 順着側軸的對其方式:alignItems:flex-start | flex-end | center | baseline | stretch;

    2. 尺寸沒有單位,表明與設備無關的獨立像素:android解釋爲dp,ios上爲sp 
    3. 一些邊距,都爲不帶單位的num
      1. 外邊距:margin | marginLeft | marginRight | marginTop | marginBottom
      2. 內邊距:padding | paddingLeft | paddingRight | paddingTop | paddingBottom
      3. 邊緣:left | right | top | bottom
相關文章
相關標籤/搜索