0
new ListView(
children: <Widget>[
new RaisedButton(child: const Text('1')),
],
)
如何使按钮仅占其自然宽度是多少?
new ListView(
children: <Widget>[
new RaisedButton(child: const Text('1')),
],
)
如何使按钮仅占其自然宽度是多少?
考虑将您的RaisedButton
换成。除了让该按钮成为其固有宽度外,还可以使用通过使用构造函数的参数mainAxisAlignment
来水平定位按钮。例如右对齐按钮,使用此:
new ListView(
children: <Widget>[
new Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
new RaisedButton(
child: const Text('1'),
onPressed:() { /* ... */ },
),
],
),
],
),