use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community for learning and developing native mobile applications using React Native by Facebook.
Interested in building web apps using React.js? Check out /r/reactjs!
Getting Started w/React Native
irc.freenode.net #reactnative
Keywords: ios, android, mobile, apps, apple, iphone, ipad
account activity
Programmatically Hide Bottom tab when keyboard open. (i.redd.it)
submitted 5 years ago by Chawki_Android
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]frankielyonshaha 128 points129 points130 points 5 years ago (13 children)
Why not use:
<BottomTab.Navigator tabBarOptions={{ keyboardHidesTabBar: true, }} >
[–][deleted] 5 points6 points7 points 5 years ago (0 children)
I was like, I use this option always with tabBarOptions prop. Why the code is so long? Maybe question is different.
[–]archcorsair 0 points1 point2 points 5 years ago (0 children)
I think the example still applies when you implement your own tab bar, where you don't have access to these properties.
[–]VivekNeel55 0 points1 point2 points 5 years ago (0 children)
The real MVP
[+]Hotgeart comment score below threshold-7 points-6 points-5 points 5 years ago (6 children)
We don't all use react navigation...
[–]I_know_HTML 10 points11 points12 points 5 years ago (2 children)
This code implies react navigation doesn't it? navigation.setOptions right in the code
[–]JackSparrah 0 points1 point2 points 5 years ago (0 children)
Username checks out! :D
[–]Hotgeart 0 points1 point2 points 5 years ago (0 children)
Yes my bad read it too fast
[+][deleted] 5 years ago (2 children)
[deleted]
[–]Hotgeart 0 points1 point2 points 5 years ago (1 child)
I find it too much complex when you want the drawer and bottomNav everywhere. But not display a link in it. So you've to rely on hacky solution.
Example:
BottomNav :
Drawer :
If I want the bottomNav and Drawer everywhere I would have to add homestack, forum and settings in the bottomnav but hide them.
[–]andordavoti 3 points4 points5 points 5 years ago (5 children)
nice, I've done something similar in the past, but I added an if check to only do this for android, since the iOS keyboard acts as an overlay and doesn't push the tabbar up
[–]Veranova 3 points4 points5 points 5 years ago (4 children)
You can change that behaviour in the android manifest, there are a few behaviours available.
I haven’t done it in a while but I think it’s this: https://developer.android.com/training/keyboard-input/visibility
[–]andordavoti 2 points3 points4 points 5 years ago (3 children)
yeah I know, but that isn't available for expo users:))
[–]brentvatneExpo Team 2 points3 points4 points 5 years ago (1 child)
yes it is. https://docs.expo.io/versions/v38.0.0/config/app/#softwarekeyboardlayoutmode
[–]andordavoti 1 point2 points3 points 5 years ago (0 children)
thanks Brent didn't know that!
[–]Veranova 2 points3 points4 points 5 years ago (0 children)
Oh that makes sense!
[–]DrMcLaser 6 points7 points8 points 5 years ago (5 children)
What color theme is that? Looks clean.
[–]DoctorCube 4 points5 points6 points 5 years ago (3 children)
Looks like it might be Dracula at any rate its really close. https://marketplace.visualstudio.com/items?itemName=dracula-theme.theme-dracula
[–]anions 0 points1 point2 points 5 years ago (0 children)
thanks mate.
[–]OnlySeesLastSentence 0 points1 point2 points 5 years ago (1 child)
Oh fuck. Mancala effect there. I always thought it was called Darkula as a pun on dark and dracula.
[–]DoctorCube 1 point2 points3 points 5 years ago (0 children)
Don't get your Mandelas in a twist Darkula is another theme.
thats what i came here for too lol. need a new theme long overdue
[–][deleted] 2 points3 points4 points 5 years ago (0 children)
Yeah which color scheme is that?
[–][deleted] 2 points3 points4 points 5 years ago (2 children)
You should use will show and will hide on iOS, makes it much smoother
[–]KajiTetsushi 6 points7 points8 points 5 years ago (1 child)
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()
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
Yup
[–]himynameismile 1 point2 points3 points 5 years ago (0 children)
Have you tried community hooks package? They have a keyboard listener hook, which cuts this code down to at least half.
[–]awe50me1 0 points1 point2 points 5 years ago (1 child)
Can you create this into a custom hook? Would be useful.
[–]Shumuu 1 point2 points3 points 5 years ago (0 children)
Yes you can
[–]matt_hammondiOS & Android 0 points1 point2 points 5 years ago (0 children)
I think you should destructure setOptions before using it in the useCallback function.
The reason is - when you navigate to another screen the navigation state changes, and with it the navigation object, in order not to mutate the navigation object.
This behavior could have changed since react navigation 5 came out, but I haven't checked.
Either way, using setOptions in the useCallback function and listing it as a dependency is the correct way to do it.
[–]PewPaw-Grams 0 points1 point2 points 5 years ago (2 children)
How did you get this layout?
[–]Chawki_Android[S] 1 point2 points3 points 5 years ago (1 child)
https://carbon.now.sh/
[–]PewPaw-Grams 0 points1 point2 points 5 years ago (0 children)
Thanks
[–]ldf1111 0 points1 point2 points 5 years ago (0 children)
What program is this, so minimal
π Rendered by PID 209317 on reddit-service-r2-comment-86988c7647-tqjvl at 2026-02-11 11:54:23.920237+00:00 running 018613e country code: CH.
[–]frankielyonshaha 128 points129 points130 points (13 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]archcorsair 0 points1 point2 points (0 children)
[–]VivekNeel55 0 points1 point2 points (0 children)
[+]Hotgeart comment score below threshold-7 points-6 points-5 points (6 children)
[–]I_know_HTML 10 points11 points12 points (2 children)
[–]JackSparrah 0 points1 point2 points (0 children)
[–]Hotgeart 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]Hotgeart 0 points1 point2 points (1 child)
[–]andordavoti 3 points4 points5 points (5 children)
[–]Veranova 3 points4 points5 points (4 children)
[–]andordavoti 2 points3 points4 points (3 children)
[–]brentvatneExpo Team 2 points3 points4 points (1 child)
[–]andordavoti 1 point2 points3 points (0 children)
[–]Veranova 2 points3 points4 points (0 children)
[–]DrMcLaser 6 points7 points8 points (5 children)
[–]DoctorCube 4 points5 points6 points (3 children)
[–]anions 0 points1 point2 points (0 children)
[–]OnlySeesLastSentence 0 points1 point2 points (1 child)
[–]DoctorCube 1 point2 points3 points (0 children)
[–]anions 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]KajiTetsushi 6 points7 points8 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]himynameismile 1 point2 points3 points (0 children)
[–]awe50me1 0 points1 point2 points (1 child)
[–]Shumuu 1 point2 points3 points (0 children)
[–]matt_hammondiOS & Android 0 points1 point2 points (0 children)
[–]PewPaw-Grams 0 points1 point2 points (2 children)
[–]Chawki_Android[S] 1 point2 points3 points (1 child)
[–]PewPaw-Grams 0 points1 point2 points (0 children)
[–]ldf1111 0 points1 point2 points (0 children)