

Flutter 线性布局:Column 和 Row
source link: https://www.kymjs.com/note/2020/03/18/01/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Flutter 线性布局:Column 和 Row
mainAxisSize
: 控制自己的布局方式
MainAxisSize.min
默认值,Column和Row自适应children;
MainAxisSize.max
Column填充父控件竖屏,Row填充父控件横屏;需要搭配MainAxisAlignment
使用才有效果;
mainAxisAlignment
: 控制子集的对齐方式,Column上下对齐,Row左右对齐
MainAxisAlignment.start
默认值,Column靠上,Row靠左;
MainAxisAlignment.center
Column,Row居中;
MainAxisAlignment.end
Column靠下,Row靠右;
MainAxisAlignment.spaceAround
自己填充,等份分配空间给子集,子集各自居中对齐;
MainAxisAlignment.spaceBetween
自己填充,等份分配空间给子集,子集两侧对齐;
MainAxisAlignment.spaceEvenly
自己填充,等份分配空间给子集,子集同一中线居中对齐;
注:当设置MainAxisSize.max
时才该值有效果。
crossAxisAlignment
: 控制子集各自的对齐方式,Column左右对齐,Row上下对齐
CrossAxisAlignment.strech
Column中会使子控件宽度调到最大,Row则使子控件高度调到最大
CrossAxisAlignment.start
Column中会使子控件向左对齐,Row中会使子控件向上对齐
CrossAxisAlignment.center
默认值,子控件居中
CrossAxisAlignment.end
Column中会使子控件向右对齐,Row中会使子控件向下对齐
CrossAxisAlignment.baseline
按文本水平线对齐。与TextBaseline
搭配使用
textBaseline
:
TextBaseline.alphabetic
用于对齐字母字符底部的水平线。
TextBaseline.ideographic
用于对齐表意字符的水平线。
verticalDirection
: 控制子控件对齐方式是否相反方式
VerticalDirection.down
默认值,按照默认方式
VerticalDirection.up
CrossAxisAlignment.start
跟CrossAxisAlignment.end
对反
Recommend
-
8
Column vs Row I’ve been working with databases for a long time. They’ve always been relational databases to me, unless they were a key-value,...
-
12
Blog Experimenting with column- and row-oriented datastructures Published on October 18, 2021 by Phil Eaton pythondata struct...
-
4
Sorting a matrix by row or column statistics 1
-
3
Introduction This article shows one of the possible ways to freeze HTML table columns and rows with CSS only,...
-
8
SpreadProcessing: Referencing Whole Columns and Rows Makes Formulas Faster ...
-
4
Column Vectors Vs. Row Vectors Column Vectors Vs. Row Vectors The following are excerpts from an interesting Usenet discussion about the differences in convention between using column vectors or row vectors. This drives...
-
7
Shorthand notation for row and column operations
-
12
Column Major and Row Major Vectors and Matrices (for games) Dec 26, 2022 This is yet another post about understanding the difference between column major and row major...
-
5
Minimum index at which 1 row and 1 column completely vanishespradeep6036ymcaGiven an array X[] and a matrix M[][]. Then the task is to out...
-
7
Flutter 的线性布局组件学习笔记 线性布局组件 Row 和 Column 继承自 Flex Row 行组件 主轴方向是从左到右,侧轴方向是从上到下 行组件宽度是自适应的,默认占满一行...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK