flutter - 如何在容器小部件中添加多行?
问题描述
我想Row
在容器小部件中添加一些 s,这是我尝试做的。s 不会出现Row
在垂直位置,而是出现在水平位置。
Container(
height: 50,
color:Color(0xFFFFFF),
child: Row(children: <Widget>[
Row(children:<Widget>[
Text('L\'intelligent d\'Abidjan en ligne')]),
Row(children:<Widget>[Text('le journal en ligne dont vous avez rêvé', style: TextStyle(fontSize:
20))]),
Row(children:<Widget>[RaisedButton(onPressed: (){},
shape: roundedRectangleBorder,
child: Text('cliquez pour vous abonner', style: TextStyle(fontSize: 20)),
color: Color(0xFF1705),
)]),
Row(children:<Widget>[Text('le journal en ligne dont vous avez rêvé', style: TextStyle(fontSize:
20)) ])
]),
),
解决方案
您必须将顶部小部件保留为Column
并将您的所有子组件包装Rows
为它..
像这样..
Container(
child: Row(
children: <widget>[
Row(), //your 1st Row
Row(), //your 2nd Row
Row(), //your 3rd Row
],
),
)
具体来说,就您而言..我相信,您应该这样做..
Container(
height: 50,
color:Color(0xFFFFFF),
child: Column( //you kept this as Row
children: <Widget>[
Row(children:<Widget>[
Text('L\'intelligent d\'Abidjan en ligne')]),
Row(children:<Widget>[Text('le journal en ligne dont vous avez rêvé', style: TextStyle(fontSize:
20))]),
Row(children:<Widget>[RaisedButton(onPressed: (){},
shape: roundedRectangleBorder,
child: Text('cliquez pour vous abonner', style: TextStyle(fontSize: 20)),
color: Color(0xFF1705),
)]),
Row(children:<Widget>[Text('le journal en ligne dont vous avez rêvé', style: TextStyle(fontSize:
20)) ])
]),
希望它能回答你的问题..
推荐阅读
- azure - 如何在 Microsoft azure 云中部署 index.html 文件?
- javascript - JQuery Timepicker 响应问题
- keras - keras 有像 VGG19 这样的预训练 AlexNet 吗?
- vba - 如何修复:ThisDocument.Close 冻结 MS Word
- google-app-engine - AppEngine Standard:如何根据服务名称和版本进行调度?
- spring-boot - 在同一个 server.xml 配置中运行两个战争实例
- r - 查找 ROC 曲线列表的外壳的代码(曲线集的上限和下限)
- python - 使用 pandas 2 比较两列
- java - java - 如何使用okhttp在java中缓存多线程API调用?
- jboss - 如何通过 web 服务传递与 jbpm 中的人工任务相关联的对象中的值?