Nan-Tang 2021-09-10 16:02 采纳率: 66.7%
浏览 20
已结题

Flutter中TabBar的按钮字体颜色为什么点击的时候没有改变,

  • ```
    TabBar(
                      indicatorColor: Color(0xFFffb305),
                      unselectedLabelColor: Color(0xFF8d8f8e),
                      indicatorSize: TabBarIndicatorSize.tab,
                      tabs: [
                        Container(
                          height: 36,
                          padding: EdgeInsets.only(bottom: 10),
                          child: Text("待办事宜",textAlign:TextAlign.center,style: TextStyle(fontSize:16,color: Color(0xFF8d8f8e)),),
                        ),
                        Container(
                          height: 36,
                          padding: EdgeInsets.only(bottom: 10),
                          child: Text("待阅事宜",textAlign:TextAlign.center,style: TextStyle(fontSize:16,color: Color(0xFF8d8f8e)),),
                        ),
                        Container(
                          height: 36,
                          padding: EdgeInsets.only(bottom: 10),
                          child: Text("在办事宜",textAlign:TextAlign.center,style: TextStyle(fontSize:16,color: Color(0xFF8d8f8e)),),
                        ),
                        Container(
                          height: 36,
                          padding: EdgeInsets.only(bottom: 10),
                          child: Text("已办事宜",textAlign:TextAlign.center,style: TextStyle(fontSize:16,color: Color(0xFF8d8f8e)),),
                        ),
                      ],
                    ),
    

```

  • 写回答

1条回答 默认 最新

  • 不担心 2021-09-12 18:18
    关注

    你要设置labelColor和unselectedLabelColor,这两个才是成对的
    indicatorColor应该是指底部那条横线的颜色

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 10月2日
  • 已采纳回答 9月24日
  • 创建了问题 9月10日

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持