我的问题是我必须为TabBarView
设置固定的高度才能解决RenderBox
的错误,不幸的是,此尺寸是固定的,并且不能由孩子的身高扩展。我该如何解决?
我测试了Expanded
,SizedBox.expanded
,但没有任何变化
Scaffold <----------------parent
SingleChildScrollView <---child
Stack <-----------------child
Padding <-----------------child
Column <-----------------child
Container( <--------------child
height: 250.0,
child: TabBarView(
children: [
Column(
),
Column(
),
Column(
),
],
controller: tabController,
),
),
);
答案 0 :(得分:1)
我不确定您希望UI的外观如何,但是您可以尝试以下两种解决方案:
使用val listSizesArray = arrayOf("UK7","UK8","UK9","UK10");
println(listSizesArray.contentToString()); //[UK7, UK8, UK9, UK10]
并提供一些LimitedBox
maxHeight
删除SingleChildScrollView(
physics: BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
child: Stack(
children: <Widget>[
Column(
children: <Widget>[
LimitedBox( // use this
maxHeight: 200, // give some maxHeight
child: TabBarView(
children: [
FlutterLogo(colors: Colors.orange, size: 100,),
FlutterLogo(colors: Colors.red, size: 100),
],
),
),
SizedBox(height: 50),
FlutterLogo(size: 100),
SizedBox(height: 100),
FlutterLogo(size: 100),
],
),
],
),
)
并添加SingleChildScrollView
Expanded