Bur*_*rak 28 flutter flutter-layout
我正在尝试使用VerticalDivider小部件来分隔Row. 这里是全身。
排:
Row(
children: <Widget>[
Text('420 Posts', style: TextStyle(color: Color(0xff666666)),),
VerticalDivider(
thickness: 2,
width: 20,
color: Colors.black,
),
Text('420 Posts', style: TextStyle(color: Color(0xff666666)),)
],
),
Run Code Online (Sandbox Code Playgroud)
Cra*_*Cat 73
包装你Row有IntrinsicHeight,
IntrinsicHeight(
child: Row(
children: <Widget>[
Text('420 Posts', style: TextStyle(color: Color(0xff666666)),),
VerticalDivider(
thickness: 2,
width: 20,
color: Colors.black,
),
Text('420 Posts', style: TextStyle(color: Color(0xff666666)),)
],
),
)
Run Code Online (Sandbox Code Playgroud)
小智 25
VerticalDivider 需要高度才能正常工作,请将其与 SizedBox 或定义了高度参数的等效项一起使用。
例子:
SizedBox(
height: 40
child: VerticalDivider(
thickness: 2,
width: 20,
color: Colors.black,
),
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8572 次 |
| 最近记录: |