首页 > 解决方案 > 如何删除 TabBarView 不可见填充?

问题描述

如何删除 TabBarView 不可见填充?我将 2 个按钮放入其中,但按钮的 2 个边缘似乎被切断了几个像素。我如何解决它?

DefaultTabController(
        length: 2,
        initialIndex: _setInitialTab(context),
        child: Scaffold(
          appBar: TabBar(
            // labelPadding: EdgeInsets.all(0),
            // indicatorPadding: EdgeInsets.all(0),
            labelStyle: TextStyle(fontSize: 17),
            indicatorColor: AppSetting.buttonColor1,
            unselectedLabelColor: AppSetting.buttonDisabledColor1,
            indicatorSize: TabBarIndicatorSize.tab,
            indicatorWeight: 2,
            tabs: <Tab>[
              Tab(text: "Popular"),
              Tab(text: "New"),
            ],
            onTap: (value) {
            },
          ),
          body: TabBarView(
            physics: NeverScrollableScrollPhysics(),
            children: [
              _tab(context, Tab.Popular),
              _tab(context, Tab.New),
            ],
          )
        )
      )

在此处输入图像描述

标签: flutterdart

解决方案


推荐阅读