英文:
How to remove elevation or box shadow in tab bar in flutter?
问题
我在我的一个屏幕上使用了选项卡栏。正如您所看到的,当我滚动时,选项卡栏下面会出现高程。我尝试了多种方法来移除它,但无法成功。您们有关于这个的任何想法吗?
这是代码部分:
TabBar(
indicatorSize: TabBarIndicatorSize.tab,
isScrollable: false,
controller: _tabController,
indicatorPadding: EdgeInsets.only(left: 16.w, right: 16.w),
tabs: [tab1(), tab2(), tab3()],
)
英文:
I am using tab bar in one of my screen. As you can see when I scroll there comes the elevation under the tab bar. I tried multiple ways to remove that, but can't. Do you guys have any idea on this ?
This is the code
TabBar(
indicatorSize: TabBarIndicatorSize.tab,
isScrollable: false,
controller: _tabController,
indicatorPadding: EdgeInsets.only(left: 16.w, right: 16.w),
tabs:[tab1(),tab2(),tab3(),
],
)
答案1
得分: 0
我假设这不是TabBar
的高程。这是AppBar
的阴影,因为您(在我看来)将TabBar
放在AppBar
内。所以请按照以下方式设置AppBar
:
appBar: AppBar(
....,
elevation: 0,
),
英文:
I am assuming that it is not TabBar
elevation. It is a shadow of AppBar
as you are putting(in my opinion) TabBar
inside AppBar
. So do like this with your AppBar
:
appBar: AppBar(
....,
elevation: 0,
),
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论