0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

React 基本のstyleちょこっと

Posted at

React Native

flex: 1

指定されているスペースと同じ、つまりその場いっぱいに適用される

flexDirection: "colum"
flexDirection: "row"

columはその中にある要素(ちなみにこれが子って言われるやつ)が縦に並ぶ
何も指定しなかったら勝手にcolumになる。
rowは要素が横に並ぶ

alignItems: "center"
alignItems: "flex-start"
alignItems: "flex-end"

予想つくかもやけど
上から中央揃え、左揃え、右揃え

justifyContent: "center"
justifyContent: "flex-start"
justifyContent: "flex-end"

これはflexDirectionの軸に対してどうやって寄せるか。。。?は?
つまりーーー箱が3つあってflexDirectionがcolumでflexDirectionがcenterだったら真ん中に箱が3つ縦に”画面のど真ん中で”並ぶ
flexDirectionがrowでflexDirectionがcenterだったら画面の真ん中で横に3つ並ぶってことやな

まあわからんかったら色んな組み合わせでやってる!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?