mobile – Flutter – 位于另一个小部件下方的列表视图

mobile – Flutter – 位于另一个小部件下方的列表视图,第1张

概述我是从Flutter开始的,我遇到了一个我无法构建的布局,在一个可视化示例下面: 我已经尝试过类似的东西: class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( 我是从Flutter开始的,我遇到了一个我无法构建的布局,在一个可视化示例下面:

我已经尝试过类似的东西:

class MyApp extends StatelessWidget {          @overrIDe          Widget build(BuildContext context) {            return new MaterialApp(              Title: 'Welcome to Flutter',home: new Scaffold(                  appbar: new Appbar(                    Title: new Text('App'),),body: new Column(                      children: <Widget>[                        new Text('ListA',style: new TextStyle(                              FontSize: 15.2,FontWeight: FontWeight.bold,)                        ),new Container(                          height: 200.0,child: new ListVIEw(                            children: <Widget>[                              new Raisedbutton(                                onpressed: null,child: new Text("text button"),new padding(padding: new EdgeInsets.all(5.00)),new Raisedbutton(                                onpressed: null,child: new Text("text button 2"),)                            ],)                      ]                  )              ),);          }        }

但是对于Container来说它需要一个高度,我需要它来占据屏幕的其余部分.

解决方法
new Column(    children: <Widget>[        new Text('ListA',style: new TextStyle(            FontSize: 15.2,)),new Expanded(            child: new Container(                decoration: new Boxdecoration(color: colors.blue),height: 200.0,child: new ListVIEw(                    children: <Widget>[                        new Raisedbutton(                            onpressed: null,new Raisedbutton(                            onpressed: null,)                    ],)        )    ])
总结

以上是内存溢出为你收集整理的mobile – Flutter – 位于另一个小部件下方的列表视图全部内容,希望文章能够帮你解决mobile – Flutter – 位于另一个小部件下方的列表视图所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1004138.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存