圖示未顯示在底部選項卡中。我嘗試過放置來自不同庫的不同圖示。它顯示默認的交叉框而不是所有圖示。
import React from 'react'
import HomeScreen from './Screens/HomeScreen'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { FontAwesome5,Entypo } from '@expo/vector-icons';
import MapScreen from './Screens/MapScreen';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
const Tab = createBottomTabNavigator();
const TabNavigator=()=>{
return (
<Tab.Navigator screenOptions={{
tabBarShowLabel: true,
headerShown:false,
tabBarStyle:{backgroundColor:'#5B8C2A'},
tabBarInactiveTintColor:"#A9A9A9",
tabBarInactiveBackgroundColor:'',
tabBarActiveTintColor:"white",
tabBarActiveBackgroundColor:'#5B8C29',
tabBarHideOnKeyboard:true
}}>
<Tab.Screen name="Home" component={HomeScreen} Options={{
tabBarIcon:({size,color})=>(
<MaterialCommunityIcons name="home" size={size} color={color} />
),
}}/>
<Tab.Screen name="Map" component={MapScreen} Options={{
tabBarIcon:({size,color})=>(
<Entypo name="globe" size={size} color={color} />
)
}}/>
</Tab.Navigator>
);
}
export default TabNavigator
圖示未顯示在底部選項卡中。我嘗試過放置來自不同庫的不同圖示。它顯示默認的交叉框而不是所有圖示。除此之外一切正常。甚至導航也能正常作業。
uj5u.com熱心網友回復:
它不是選項,而是選項,小寫。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/418413.html
標籤:
