Я изменил цвет фона, чтобы сделать его более заметным. Я хочу, чтобы красный контейнер стал прозрачным. ![enter image description here](https://i.stack.imgur.com/FC7Fx.png)
Есть ли способ добиться этого? Я использую реагирующую навигацию 5 и создал собственную нижнюю панель вкладок в соответствии с Bottom-tab-navigator
Код, который я использую для нижней панели, следующий
import React from 'react';
import { View, StyleSheet } from 'react-native';
import colors from 'styles/colors';
import TabBarItem from './TabBarItem/TabBarItem';
const homeIcon = require('assets/maps.png');
export enum Item {
Home,
ProfileView,
}
const DashboardTabBar: React.FC<{}> = ({ state, descriptors, navigation }) => {
return (
<View style={styles.container}>
<View style={styles.innerContainer}>
{state.routes.map((route, index) => {
const { options } = descriptors[route.key];
const isFocused = state.index === index;
const onPress = () => {
const event = navigation.emit({
type: 'tabPress',
target: route.key,
});
if (!isFocused && !event.defaultPrevented) {
navigation.navigate(route.name);
}
};
const onLongPress = () => {
navigation.emit({
type: 'tabLongPress',
target: route.key,
});
};
return (
<TabBarItem
icon={homeIcon}
isFocused={isFocused}
onPress={onPress}
onLongPress={onLongPress}
options={options}
key={route.key}
/>
);
})}
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
padding: 10,
paddingBottom: 18,
backgroundColor: 'red', // I tried with 'transparent' here, but i see a white background instead of transparent
},
innerContainer: {
height: 60,
backgroundColor: colors.GREY_L_10,
flexDirection: 'row',
justifyContent: 'space-evenly',
alignItems: 'center',
borderRadius: 50,
borderWidth: 1,
borderColor: colors.GREY,
},
});
export default DashboardTabBar;
Насколько я посмотрел в коде, я не мог найти способ сделать его прозрачным.