gpt4 book ai didi

In Flutter How to align textfield to the top with rest of the column(如何将文本字段与列的其余部分与顶部对齐)

转载 作者:bug小助手 更新时间:2023-10-28 11:34:44 25 4
gpt4 key购买 nike



This is how the columns are aligned.

这就是列的对齐方式。


enter image description here


The weight textfield needs to move up to align with the green column. It should maintain the same width.

权重文本字段需要向上移动以与绿色列对齐。它应该保持相同的宽度。


Flutter code:

颤振代码:


    Row(
children: [
Expanded(
flex: 1,
child: Container(
color: Colors.indigo,
height: 50,
child: const TextField(
decoration: InputDecoration(
labelText: 'Weight',
border: OutlineInputBorder(),
),
),
)),
Expanded(
flex: 3, child: Container(color: Colors.teal, height: 100)),
Expanded(
child: Container(
height: 100,
child: Column(
children: [
Row(children: [
Text("test1", style: TextStyle(fontSize: 25)),
Text("test1")
]),
Row(children: [Text("test2"), Text("test2")])
],
),
),
),
],
),

更多回答
优秀答案推荐

You need to use this parameter (Row):

您需要使用此参数(行):


crossAxisAlignment: CrossAxisAlignment.start,


In the top-level Row Widget, add crossAxisAlignment.start

在顶级Row Widget中,添加cross AxisAlignment.start


更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com