flutter row 里面的元素分别居左和居右对齐
1.mainAxisAlignmentnewRow(mainAxisAlignment:MainAxisAlignment.spaceBetween,children:[newText("left"),newText("right")]);2.ExpandedRow(children:<Widget>[FlutterLogo(),//左对齐Expanded(child:SizedBo.
·
1.mainAxisAlignment
new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Text("left"),
new Text("right")
]
);
2.Expanded
Row(
children: <Widget>[
FlutterLogo(),//左对齐
Expanded(child: SizedBox()),//自动扩展挤压
FlutterLogo(),//右对齐
],
);
3.Spacer
Row(
children: <Widget>[
FlutterLogo(),
Spacer(),
FlutterLogo(),
],
);
4.Flexible
Row(
children: <Widget>[
FlutterLogo(),
Flexible(fit: FlexFit.tight, child: SizedBox()),
FlutterLogo(),
],
);
更多推荐
已为社区贡献66条内容
所有评论(0)