[Flutter] Row, Column 위젯 정렬

정태녕·2024년 1월 6일
0

flutter

목록 보기
2/7

RowColumn 위젯을 작업하는 경우 각각의 위젯을 원하는 위치에 정렬해야하는 상황이 발생한다 .이런 경우 사용하는 것이 MainAxisaligmentCrossAxisaligment이다.

MainAxisaligment를 사용할지 CrossAxisaligment를 사용할지는 그 위젯이 Row인지 Column인지를 확인하고 본인이 원하는 기준에 맞춰 사용하는게 좋다.

1. Row(가로)위젯 경우 Mainaxis(주축)는 가로, Crossaxis(횡축)는 세로이다.



2. Column(세로)위젝의 경우 Mainaxis(주축)는 세로, Crossaxis는 가로이다.



3. 두가지 모두 열거형 상수를 제공한다.

MainAxisaligment enum

CrossAxisaligment enum


추가)

spacebetween, spacearound, spaceevently, stretch의 차이

profile
Mobile App Developer

0개의 댓글