你能告诉我为什么底部空间不够吗?我给了容器足够的高度,但即使增加到 500,错误也不会消失。我的错误是什么?
我的代码-
DefaultTabController(
length: 5,
child: SingleChildScrollView(
child: Container(
height: 150,
child: TabBar(
isScrollable: true,
tabs: [
Tab(child: Column(
children: [
InkWell(
onTap: () async {
print('asdasda');
},
child: Container(
width: 71,
height: 71,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle
),
child: IconButton(onPressed: () {}, icon: Icon(Icons.phone_iphone, size: 30, color: configColors.homeIcon,)),
),
),
Text('Phonesss')
],
),),
最佳答案
为您的选项卡提供高度
DefaultTabController(
length: 5,
child: SingleChildScrollView(
child: Container(
height: 150, // may remove
child: TabBar(
height: 150, // give height
isScrollable: true,
tabs: [
Tab(child: Column(
children: [
InkWell(
onTap: () async {
print('asdasda');
},
child: Container(
width: 71,
height: 71,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle
),
child: IconButton(onPressed: () {}, icon: Icon(Icons.phone_iphone, size: 30, color: configColors.homeIcon,)),
),
),
Text('Phonesss')
],
),),
关于flutter - 为什么 Tapbar 空间不够?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73443172/