react-navigation

How to deal with safeAreaView + React Navigation?

两盒软妹~` 提交于 2020-08-24 13:10:01
问题 First screenshot was without applying SafeAreaView and second screenshot is applying SafeAreaView As shown clearly that Stack header seems bulky as compare to previously. Is there anyway where we can apply SafeAreaView to only bottom part? 回答1: Instead of using SafeAreaView from React-Native , use SafeAreaView from react-navigation as below: import { SafeAreaView } from 'react-navigation'; Then you can use prop forceInset to customize the padding, which in your case, <SafeAreaView style=

react-native createBottomTabNavigator shows weird tab bar on Android

烈酒焚心 提交于 2020-08-09 09:20:11
问题 I am using react-navigation createBottomTabNavigator to create a bottom tabs navigation. The tab bar appears fine on iOS but on Android, it appears as below: I am not sure what is causing to have this weird styling. Below is my code to create the bottom tab bar: <Provider store={store}> <NavigationContainer theme={GlobalConfig.theme}> <Tab.Navigator screenOptions={({route}) => ({ tabBarIcon: ({focused, color, size}) => { let iconSrc if (route.name === 'Alarms') { iconSrc = require('../img/ic

react-native createBottomTabNavigator shows weird tab bar on Android

允我心安 提交于 2020-08-09 09:20:01
问题 I am using react-navigation createBottomTabNavigator to create a bottom tabs navigation. The tab bar appears fine on iOS but on Android, it appears as below: I am not sure what is causing to have this weird styling. Below is my code to create the bottom tab bar: <Provider store={store}> <NavigationContainer theme={GlobalConfig.theme}> <Tab.Navigator screenOptions={({route}) => ({ tabBarIcon: ({focused, color, size}) => { let iconSrc if (route.name === 'Alarms') { iconSrc = require('../img/ic

React Navigation: receiving 'undefined' with this.props.navigation.state.params

断了今生、忘了曾经 提交于 2020-08-08 08:17:19
问题 I have a strange problem when I am passing props down to another screen. I am passing two parameters; title and body , to ArticleBody screen. class ListButtonWrapper extends React.Component { constructor(props){ super(props); this.articleSelected = this.articleSelected.bind(this); } articleSelected() { this.props.navigation.navigate('ArticleBody', { title: this.props.title, body: this.props.body }); } When the button is pressed, it should pass those props to the next screen. And it does!

React Navigation: receiving 'undefined' with this.props.navigation.state.params

ぐ巨炮叔叔 提交于 2020-08-08 08:17:19
问题 I have a strange problem when I am passing props down to another screen. I am passing two parameters; title and body , to ArticleBody screen. class ListButtonWrapper extends React.Component { constructor(props){ super(props); this.articleSelected = this.articleSelected.bind(this); } articleSelected() { this.props.navigation.navigate('ArticleBody', { title: this.props.title, body: this.props.body }); } When the button is pressed, it should pass those props to the next screen. And it does!