我將一些底部導航欄專案放在我的應用程式選單中,我希望它們有一些標簽。我貼了標簽,但我真的不知道如何改變它們的基色。就像我希望他們都是白人。
這是其中之一的代碼:
bottomNavigationBar: BottomNavigationBar(
unselectedLabelStyle: const TextStyle(color: Colors.white, fontSize: 14),
backgroundColor: const Color(0xFF084A76),
fixedColor: Colors.white,
items: [
BottomNavigationBarItem(
icon: InkWell(
onTap: () async {
//Borramos un lote
deleteLote();
},
child: Container(
height: 47,
width: 50,
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Colors.black38),
child: const Icon(
Icons.delete,
size: 32,
color: Colors.white,
),
),
),
label: 'Borrar Lote'),
BottomNavigationBarItem(
icon: InkWell(
onTap: () async {
//A?adimos un lote
addLote();
},
child: Container(
height: 47,
width: 50,
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Colors.black38),
child: const Icon(
Icons.add,
size: 32,
color: Colors.white,
),
),
),
label: 'A?adir Lote')
],
)
它現在的樣子的影像,供參考:

uj5u.com熱心網友回復:
而是使用:
unselectedLabelStyle: const TextStyle(color: Colors.white, fontSize: 14),
你可以試試 :
unselectedItemColor: Colors.white,
unselectedFontSize: 14,
在您的底部導航欄中
uj5u.com熱心網友回復:
你必須unselectedItemColor在你的BottomNavigationBar.
bottomNavigationBar: BottomNavigationBar(
unselectedLabelStyle: const TextStyle(color: Colors.white, fontSize: 14),
backgroundColor: const Color(0xFF084A76),
fixedColor: Colors.white,
unselectedItemColor: Colors.white, //<-- add this
...
更多細節:底部導航欄
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/374035.html
上一篇:用于顫振的IF和ELSE|Flutter&DART的作業原理
下一篇:使用空格作為串列分隔符
