【发布时间】:2019-01-02 05:50:12
【问题描述】:
您好,我在 Flutter 中有一个标签栏,我想禁用标签之间的滑动
// Set the bottom navigation bar
bottomNavigationBar: new Material(
// set the color of the bottom navigation bar
color: const Color(0xFFF7F7F7),
// set the tab bar as the child of bottom navigation bar
child: new TabBar(
tabs: <Tab>[
new Tab(
// set icon to the tab
icon: new Icon(Icons.home,color: Colors.black),
),
new Tab(
icon: new Icon(Icons.favorite,color: Colors.black),
),
new Tab(
icon: new Icon(Icons.search,color: Colors.black),
),
new Tab(
icon: new Icon(Icons.settings,color: Colors.black),
),
],
// setup the controller
controller: controller,
),
),
);
}
}
我在点击每个标签栏按钮时移动标签,我想禁用滑动谢谢
【问题讨论】:
-
如果我理解正确,您会尝试禁用指示器,因为我不明白 TabBar 中的“滑动”是什么意思
-
通过滑动:我的意思是你可以通过向左或向右滑动从标签移动到另一个标签
-
看看我的回答
-
好的,谢谢你做得好!
标签: flutter