廓形仪rn版本-技术调研
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

3 months ago
3 months ago
3 months ago
  1. import { Tabs } from 'expo-router';
  2. import React from 'react';
  3. import { Platform } from 'react-native';
  4. import { HapticTab } from '@/components/HapticTab';
  5. import { IconSymbol } from '@/components/ui/IconSymbol';
  6. import TabBarBackground from '@/components/ui/TabBarBackground';
  7. import { Colors } from '@/constants/Colors';
  8. import { useColorScheme } from '@/hooks/useColorScheme';
  9. export default function TabLayout() {
  10. const colorScheme = useColorScheme();
  11. return (
  12. <Tabs
  13. screenOptions={{
  14. tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
  15. headerShown: true,
  16. tabBarButton: HapticTab,
  17. tabBarBackground: TabBarBackground,
  18. tabBarStyle: Platform.select({
  19. ios: {
  20. // Use a transparent background on iOS to show the blur effect
  21. position: 'absolute',
  22. },
  23. default: {},
  24. }),
  25. }}>
  26. <Tabs.Screen
  27. name="index"
  28. options={{
  29. title: '测量',
  30. tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
  31. }}
  32. />
  33. <Tabs.Screen
  34. name="explore"
  35. options={{
  36. title: '设置',
  37. tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
  38. }}
  39. />
  40. <Tabs.Screen
  41. name="ble"
  42. options={{
  43. title: '蓝牙',
  44. tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
  45. }}
  46. />
  47. <Tabs.Screen
  48. name="mine"
  49. options={{
  50. title: '我的',
  51. tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
  52. }}
  53. />
  54. </Tabs>
  55. );
  56. }