我遵循了官方的react导航文档,它说:
<Tab.Screen name="Home" component={HomeScreen} options={{ tabBarBadge: 3 }} />但是当像这样将这个添加到我的代码中时:
<Tab.Screen
name="Games"
component={Games}
options={{
tabBarIcon: ({ focused, color, size }) => {
let iconName;
let iconColor;
iconName = focused
? "game-controller"
: "game-controller-outline";
iconColor = focused ? "orange" : "black";
// You can return any component that you like here!
return (
<Ionicons
name={iconName}
size={28}
color={iconColor}
style={{ width: 30 }}
/>
);
},
tabBarBadge: 3,
}}
/>什么也没发生,有什么问题吗?我怎么才能修复它?
文档:React Nav 5
发布于 2021-01-04 21:56:20
我试过你的代码,它是好的。尝试检查:
https://stackoverflow.com/questions/65563694
复制相似问题