Added safe area for tab bar

This commit is contained in:
Arnaud Vergnet 2020-05-27 15:30:01 +02:00
parent a27d0b7fa6
commit 7658cbcb16

View file

@ -3,6 +3,7 @@ import {withTheme} from 'react-native-paper';
import TabIcon from "./TabIcon"; import TabIcon from "./TabIcon";
import TabHomeIcon from "./TabHomeIcon"; import TabHomeIcon from "./TabHomeIcon";
import {Animated} from 'react-native'; import {Animated} from 'react-native';
import {SafeAreaView} from 'react-native-safe-area-context';
type Props = { type Props = {
state: Object, state: Object,
@ -134,6 +135,7 @@ class CustomTabBar extends React.Component<Props, State> {
render() { render() {
this.props.navigation.addListener('state', this.onRouteChange); this.props.navigation.addListener('state', this.onRouteChange);
return ( return (
<SafeAreaView>
<Animated.View <Animated.View
ref={this.tabRef} ref={this.tabRef}
// animation={"fadeInUp"} // animation={"fadeInUp"}
@ -152,6 +154,7 @@ class CustomTabBar extends React.Component<Props, State> {
> >
{this.props.state.routes.map(this.renderIcon)} {this.props.state.routes.map(this.renderIcon)}
</Animated.View> </Animated.View>
</SafeAreaView>
); );
} }
} }