MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/reactnative/comments/iwacub/programmatically_hide_bottom_tab_when_keyboard/g5zihax/?context=3
r/reactnative • u/Chawki_ Android • Sep 20 '20
32 comments sorted by
View all comments
3
You should use will show and will hide on iOS, makes it much smoother
6 u/KajiTetsushi Sep 20 '20 The Platform.OS property can take care of that.import { Platform } from 'react-native;' const showEventType = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow'; const hideEventType = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';Then use them in the Keyboard.addListener() method. 2 u/[deleted] Sep 20 '20 Yup
6
The Platform.OS property can take care of that.
Platform.OS
import { Platform } from 'react-native;' const showEventType = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow'; const hideEventType = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
Then use them in the Keyboard.addListener() method.
Keyboard.addListener()
2 u/[deleted] Sep 20 '20 Yup
2
Yup
3
u/[deleted] Sep 20 '20
You should use will show and will hide on iOS, makes it much smoother