最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - Expo Router Bottom Tabs Customization - Stack Overflow

programmeradmin2浏览0评论

I'm pretty new to React Native and Expo, and I'm trying to get the hang of it. I just created an example app following the documentation, and I got the default welcome app. Now, I'm exploring it.

I have a bottom navigation bar with some tabs in it—mostly basic stuff. The tabs have a haptic animation that I want to remove, but I haven't been able to do so.

I read the documentation for Expo Tabs and React Navigation Bottom Tabs, where I found a property called hapticFeedbackEnabled. However, I can't seem to use it in my app.

It should be a simple customization, but now I'm confused. I would appreciate help understanding the logic of how to find and modify this animation, how to customize it, and, more generally, what approach to take to solve this problem. That would really help me catch up!

import { Tabs } from 'expo-router';
import React from 'react';
import { Platform } from 'react-native';

import { HapticTab } from '@/components/HapticTab';
import { IconSymbol } from '@/components/ui/IconSymbol';
import TabBarBackground from '@/components/ui/TabBarBackground';
import { Colors } from '@/constants/Colors';
import { useColorScheme } from '@/hooks/useColorScheme';


export default function TabLayout() {
  const colorScheme = useColorScheme();

  return (
    <Tabs
      screenOptions={{
        tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
        headerShown: false,
        tabBarButton: HapticTab,
        tabBarBackground: TabBarBackground,
        tabBarStyle: Platform.select({
          ios: {
            position: 'absolute',
          },
          default: {},
        }),
      }}>
      <Tabs.Screen
        name="index"
        options={{
          title: 'Home',
          tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
        }}
      />
      <Tabs.Screen
        name="explore"
        options={{
          title: 'Explore',
          tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
        }}
      />

      <Tabs.Screen
        name="teszt"
        options={{
          title: 'Tesztt',
          tabBarIcon: ({ color }) => <IconSymbol size={28} name="meho.fill" color={color} />
        }}
      />
    </Tabs>
  );
}

发布评论

评论列表(0)

  1. 暂无评论