【问题标题】:how to change the size of the first icon tab only flutter如何更改第一个图标选项卡的大小只会颤动
【发布时间】:2020-10-18 20:07:58
【问题描述】:
Scaffold(
        appBar: AppBar(
          bottom: TabBar(indicator: UnderlineTabIndicator(
              borderSide: BorderSide(width: 2.0),
              insets: EdgeInsets.symmetric(horizontal:10.0)),
              tabs: [
            Container(child: Tab(icon: Icon(Icons.camera_alt,))),**how to decrese the size of this tab **
            Container(child: Tab(icon: Text("CHATS"))),
            Container(child: Tab(icon: Text("STATUS"))),
            Container(child: Tab(icon: Text("CALLS"))),
          ]),

【问题讨论】:

    标签: flutter tabs tabbar


    【解决方案1】:

    TabBar 中将isScrollable 设置为true

    Scaffold(
          appBar: AppBar(
            bottom: TabBar(
              isScrollable: true,
              indicator: UnderlineTabIndicator(
                borderSide: BorderSide(width: 2.0),
                insets: EdgeInsets.symmetric(horizontal:10.0),),
              tabs: [
                Container(child: Tab(icon: Icon(Icons.camera_alt,))), // how to decrese the size of this tab **
                Container(child: Tab(icon: Text("CHATS"))),
                Container(child: Tab(icon: Text("STATUS"))),
                Container(child: Tab(icon: Text("CALLS"))),
              ],
            ),
          ),
        );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多