是否可以在react原生中创建我自己的导航选项卡栏,而不是使用react导航。我想从头开始创建一些东西,这样我就不必学习react导航技术了。
发布于 2021-10-15 10:12:39
正如Michael Bahl已经指出的那样,在软件开发中使用框架可以让你在更短的时间内获得更多的功能。如果你足够幸运,你甚至可以得到一个经过良好测试的。
也就是说,react导航提供了轻松定制某些导航元素的能力。
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
const Tab = createBottomTabNavigator();
const CustomTabNavigator = () => {
return (
<Tab.Navigator
initialRouteName="HomeTab"
screenOptions={{headerShown: false, tabBarShowLabel: false}}>
<Tab.Screen
name="NavigationTab"
component={MyScreen}
options={{
tabBarIcon: ({color}) => <TabBarIcon name="compass" color={color} />,
}}
/>
</Tab.Navigator>
);
};
export default CustomTabNavigator;Material Top Tabs和更多的导航器也是如此,它们甚至提供了一个用于定制的API。:-)
https://stackoverflow.com/questions/69580778
复制相似问题