我制作了如下的 tabBar。
在此處輸入圖片說明
我正在使用 react-native 和 expo。但我想從 tabBar 中洗掉圖示,因為它只有文本。我的 tabBar 代碼如下所示。如何從 tabBar 中洗掉圖示?
<Tabs.Navigator
screenOptions={{
headerShown: false,
tabBarActiveTintColor: `${colors.vivid}`,
tabBarActiveBackgroundColor: `${colors.light}`,
tabBarStyle: {
backgroundColor: "white",
height: 60,
},
tabBarLabelStyle: {
fontFamily: "Katuri",
fontSize: 18,
},
}}
>
<Tabs.Screen
name="??"
options={{
tabBarIcon: ({ focused, color, size }) => (
<Ionicons name={"camera"} color={color} size={18} />
),
}}
uj5u.com熱心網友回復:
回傳 null用于tabBarIcon在options道具。
<Tabs.Screen name="??" options={{ tabBarIcon: ({ focused, color, size }) => null }}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/395416.html
上一篇:無法讀取未定義的“導航”的屬性
