-1

我是 React-Native tyro,当我尝试自定义 Tab-Navigation 时,我发现这条线我无法隐藏它(那条白线!)。

图片

我试图设置borderColor:'00000000',但它没有工作
请帮助我。

==================================================== ==============================

这是我的代码

import React from 'react';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import Home from '../screens/Home';
import Me from '../screens/Me';
import { View, Image, Text } from 'react-native';
const Tab = createBottomTabNavigator();
export default () => {
  return (
    <Tab.Navigator
      initialRouteName="Home"
      screenOptions={({ route }) => ({
        tabBarIcon: ({ focused, color, size }) => {
          let iconSrc;
          if (route.name === 'Home') {
            iconSrc = require('../assets/img/影院.png');
          } else if (route.name === 'Me') {
            iconSrc = require('../assets/img/我的.png');
          }

          // You can return any component that you like here!
          return (
            <Image
              source={iconSrc}
              resizeMode="contain"
              style={{
                width: 25,
                height: 25,
                tintColor: focused ? '#FFCF64' : '#6D6D72'
              }}
            />
          );
        },
        tabBarActiveTintColor: '#FFCF64',
        tabBarInactiveTintColor: '#6D6D72',
        tabBarStyle: {
          position: 'absolute',
          borderRadius: 25,
          height: 65,
          borderColor: '#333',
          backgroundColor: '#1a1a1a',
          bottom: 30,
          left: 10,
          right: 10
        },
        tabBarItemStyle: {
          height: 65
        }
      })}
    >
      <Tab.Screen
        name="Home"
        component={Home}
        options={{
          headerShown: false,
          tabBarShowLabel: false
        }}
      />
      <Tab.Screen
        name="Me"
        component={Me}
        options={{
          headerShown: false,
          tabBarShowLabel: false
        }}
      />
    </Tab.Navigator>
  );
};
4

1 回答 1

0

对不起,我修好了。将此代码添加到tabBarStyle'#00000000'

于 2022-01-07T06:53:15.777 回答