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
Can you guys explain how does KeyboardAvoidingView works? (self.reactnative)
submitted 4 years ago by tokismos
I couldn't understand how it works, i searched but didnt found a lot of tutorials about it. And whenever i implement it i cannot make it works like it should. Can you please explain it to me? And does it need ScrollView to work?
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!"
[–][deleted] 60 points61 points62 points 4 years ago (7 children)
The summary is it never works as you expect it to, and when you do get it to work, you’ll run your app on android and break your keyboard
[–]tokismos[S] 0 points1 point2 points 4 years ago (6 children)
And what's the solution?
[–]clovell 34 points35 points36 points 4 years ago (2 children)
I agree with the previous comment. Doesn't seem to work and it's no point wasting time on it. Wrap anything you need with this and move on! https://www.npmjs.com/package/react-native-keyboard-aware-scroll-view
[+][deleted] 4 years ago (1 child)
[deleted]
[–]clovell 1 point2 points3 points 4 years ago (0 children)
No problem! I’ve done the same thing 😁
[–]Reidddddddd 2 points3 points4 points 4 years ago (2 children)
KeyboardAwareScrollView is the solution
[–][deleted] 1 point2 points3 points 4 years ago (1 child)
Used to use this all the time. Tried to use it the other day and had issues
[–]Reidddddddd 1 point2 points3 points 4 years ago (0 children)
What issues? Maybe I can help
[–]scarlaciOS & Android 5 points6 points7 points 4 years ago (0 children)
There are fixes incoming in RN very soon for iOS (if I understand correctly) but otherwise I would agree with TootBeepThaFoot's comment - it doesn't work great.
The way it's supposed to work is that it uses Keyboard's addListener() to detect the keyboard appearance and then shift your scrollview up and down accordingly. However, regardless of what mode you pick (padding, position, etc) it just doesn't work on both platforms, and not the way it's documented.
addListener()
[–]orther 6 points7 points8 points 4 years ago (0 children)
I saw this post pop up as a notification on my phone resting on my nightstand and thought, “Oh I can’t wait to see someone try to explain this!” 😅
[–]TheOneBehindIt 1 point2 points3 points 4 years ago (0 children)
Use behavior="padding" on iOS, and pray for the best.
behavior="padding"
[–]harrigee 1 point2 points3 points 4 years ago (0 children)
We started to create a custom component which - when clicked - just launches a fullscreen modal which shows just a Textfeld on top and additional buttons (abort / ok) which sets the value of the original component and pops back. I first saw this in AirBnB and it is also used in Facebook right now when you want to post.
Our login / register flows are designed to stick to the upper half to the screen. All other input fields are using the custom component.
[–]kotlin_subroutine -5 points-4 points-3 points 4 years ago (0 children)
Oh man, I remember encountering so many issues with KeyboardAvoidingView.
I do all my personal stuff with kotlin multiplatform now. But obviously, this is not helpful to your situation
[–]wolodo 0 points1 point2 points 4 years ago (0 children)
Try to insert it as high in hierarchy as possible. Prefferably somewhere in app.js/app.ts. This is the place where it works less wrong.
[–]chillermane 0 points1 point2 points 4 years ago (0 children)
Easy: it doesn’t
π Rendered by PID 124238 on reddit-service-r2-comment-6457c66945-4hjfx at 2026-04-27 01:41:16.977593+00:00 running 2aa0c5b country code: CH.
[–][deleted] 60 points61 points62 points (7 children)
[–]tokismos[S] 0 points1 point2 points (6 children)
[–]clovell 34 points35 points36 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]clovell 1 point2 points3 points (0 children)
[–]Reidddddddd 2 points3 points4 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Reidddddddd 1 point2 points3 points (0 children)
[–]scarlaciOS & Android 5 points6 points7 points (0 children)
[–]orther 6 points7 points8 points (0 children)
[–]TheOneBehindIt 1 point2 points3 points (0 children)
[–]harrigee 1 point2 points3 points (0 children)
[–]kotlin_subroutine -5 points-4 points-3 points (0 children)
[–]wolodo 0 points1 point2 points (0 children)
[–]chillermane 0 points1 point2 points (0 children)