[英]Flutter: how to change label style color when it is selected
我想在选择选项卡时将颜色更改为蓝色,当未选择选项卡时将颜色更改为灰色我已经这样做了
TabBar(
isScrollable: true,
labelStyle: TextStyle(
fontSize: 14.0,
fontFamily: 'fontfamily',
color: Colors.blue),
unselectedLabelStyle:
TextStyle(
fontSize: 14.0, fontFamily: 'fontfamily'),
tabs: myTabs,
controller: _tabController,
),
你可以使用这个:
labelColor: Colors.blue,
unselectedLabelColor: Colors.grey,
您不必在 labelStyle 中指定文本颜色
unselectedLabelColor: Colors.grey, //for unselected label//
indicatorColor: Colors.grey, //indicates the label color when you click it//
labelColor: Colors.blue, // shows the label color //
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.