Flutter expansionTile 标题填充
Flutter expansionTile title padding
我们如何删除 Flutter ExpansionTile 中行首和标题之间的 space?
尝试用 Alignment
包裹你的 title
,如下所示
title: Align(
child: Text(
"Your text over here"
),
//You may change value from -1.5 to anything which works better for you
alignment: Alignment(-1.5, 0),
),
dense: true,
)
请尝试以下片段
ExpansionTile(title: Row(children: [
// Icon View,
// SizedBox of desired width,
// Text View
]),
children: ... ,)
如果你想删除视图外的填充
将 ExpantionTile 图块填充设置为零
ExpansionTile(tilePadding: EdgeInsets.zero,
title: Row(children: [
// Icon View,
// SizedBox of desired width,
// Text View
]),
children: ... ,)
ListTile(
title: Row(
children: <Widget>[
Icon(Icons.android),
Text("Title")
],),)
我们如何删除 Flutter ExpansionTile 中行首和标题之间的 space?
尝试用 Alignment
包裹你的 title
,如下所示
title: Align(
child: Text(
"Your text over here"
),
//You may change value from -1.5 to anything which works better for you
alignment: Alignment(-1.5, 0),
),
dense: true,
)
请尝试以下片段
ExpansionTile(title: Row(children: [
// Icon View,
// SizedBox of desired width,
// Text View
]),
children: ... ,)
如果你想删除视图外的填充 将 ExpantionTile 图块填充设置为零
ExpansionTile(tilePadding: EdgeInsets.zero,
title: Row(children: [
// Icon View,
// SizedBox of desired width,
// Text View
]),
children: ... ,)
ListTile(
title: Row(
children: <Widget>[
Icon(Icons.android),
Text("Title")
],),)