我正在尝试创建一个底部标签导航器,当我刷新文件tab .js,图标不显示在博览会移动应用程序。
我认为主要的问题是在tabBarIcon
文件tab.js
import React from "react"
import {
View,
Image,
TouchableOpacity
} from "react-native"
import {createBottomTabNavigator, BottomTabBar} from "@react-navigation/bottom-tabs"
import Home from "../screens/Home"
import { COLORS, icons } from "../constants"
import {Ionicons} from "@expo/vector-icons"
const Tab = createBottomTabNavigator();
const Tabs = () => {
return (
<Tab.Navigator
>
<Tab.Screen
name="Home"
component={Home}
s
options={{
tabBarIcon: ({focused})=> {
<Ionicons name="cart-outline" size={16} color= "#000000"
}
}}
/>
</Tab.Navigator>
)
}
export default Tabs;
Home.js文件Thanks for help
可以了
<Tab.Navigator>
<Tab.Screen
name="Home"
component={Dashboard}
options={{
tabBarIcon: ({}) => (
<Ionicons name="cart-outline" size={16} color="#000000" />
),
}}
/>
</Tab.Navigator>