jeck貓
2023-08-10 10:56:44
我想在本機反應(yīng)中單擊標(biāo)簽欄時更改標(biāo)簽欄的顏色。我嘗試使用此代碼,但它顯示了我的 iPhone 上的標(biāo)準(zhǔn)顏色。我尋找解決方案,但沒有人在工作。更改 tabBarLabel 有效,但顏色無效。你可以幫幫我嗎?這是我的代碼:const Tab = createBottomTabNavigator();<Tab.Screen name="Settings" component={Settings} tabBarBadgeStyle={{backgroundColor: '#0000ff', color:'green'}} tabBarOptions={{ tabBarLabel: 'Test', style: { backgroundColor: 'orange'} }}/>
1 回答

慕沐林林
TA貢獻(xiàn)2016條經(jīng)驗 獲得超9個贊
您必須在導(dǎo)航器中添加 tabBarOption 而不是 screen ,
<Tab.Navigator
tabBarOptions: {
activeTintColor: '#e91e63',
labelStyle: {
fontSize: 12,
},
style: {
backgroundColor: 'blue',
},
}>
<Tab.Screen
name={variable.overViewScreen}
component={Overview}
/>
<Tab.Screen
name={variable.homeScreen}
component={DashboardRoot}
/>
</Tab.Navigator>
添加回答
舉報
0/150
提交
取消