BikeApp_demo/App.tsx
2024-11-07 17:47:25 +08:00

85 lines
2.4 KiB
TypeScript

import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { View, StyleSheet, Image,Platform } from 'react-native';
import HomeScreens from './src/views/Home/HomeScreen';
import ShopScreens from './src/views/ShopScreen';
import ProfileScreens from './src/views/ProfileScreen';
import 'react-native-gesture-handler';
import { enableScreens } from 'react-native-screens';
// import { AMapSdk } from 'react-native-amap3d';
// AMapSdk.init(Platform.select({
// android: '812efd3a950ba3675f928630302c6463',
// }));
enableScreens();
type RootStackParamList = {
'爱车': undefined;
'商城': undefined;
'个人中心': undefined;
};
const Tab = createBottomTabNavigator<RootStackParamList>();
function App() {
return (
<NavigationContainer>
<Tab.Navigator screenOptions={{ headerShown: false }}>
<Tab.Screen
name="爱车"
component={HomeScreens}
options={{
tabBarIcon: ({ color, size }) => (
<Image
source={{ uri: 'https://lxnapi.ccttiot.com/bike/img/static/unny4QdTukoNl8fZYtkf' }}
style={{ width: size, height: size, tintColor: color }}
resizeMode="contain"
/>
),
}}
/>
<Tab.Screen
name="商城"
component={ShopScreens}
options={{
tabBarIcon: ({ color, size }) => (
<Image
source={{ uri: 'https://lxnapi.ccttiot.com/bike/img/static/uqJNRvkwMS4ndouxoYlX' }}
style={{ width: size, height: size, tintColor: color }}
resizeMode="contain"
/>
),
}}
/>
<Tab.Screen
name="个人中心"
component={ProfileScreens}
options={{
tabBarIcon: ({ color, size }) => (
<Image
source={{ uri: 'https://lxnapi.ccttiot.com/bike/img/static/uroSSfFVSob2kEvqTaD4' }}
style={{ width: size, height: size, tintColor: color }}
resizeMode="contain"
/>
),
}}
/>
</Tab.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
export default App;