0

I have a ScrollView on screen act like a form, and each row has a TextInput field. Right now when I focus on the lower TextInput, keyboard will come up and hide the input.

What I want to achieve is when any row's TextInput control gets focused, keyboard come-up and push up the focused cell so it's visible.

I saw some work-around or helper lib in github, such as react-native-keyboard-aware-scroll-view but all come with more or less issues. I wondering if there's a clean way to solve this problem?

Thanks and here's a simple illustration of the page I am talking about:

enter image description here

Allan Jiang
  • 11,063
  • 27
  • 104
  • 165
  • What's the issue with the lib you linked ? – yachaka Apr 03 '16 at 21:10
  • @whitep4nther It does resize correctly, but doesn't push up the cell when `TextInput` got focused. In fact I set the onFocused call back in each TextView, and followed the example to implement it: `this.refs.scroll.scrollToFocusedInput(event, reactNode)`. It shows me `Argument 0 (NSNumber) of RCTUIManager.measureLayout must not be null` (detail: https://github.com/APSL/react-native-keyboard-aware-scroll-view/issues/8). I think the problem is the second parameter `reactNode` in `onFocus` callback is null. – Allan Jiang Apr 03 '16 at 22:12
  • Possible duplicate of [How to auto-slide the window out from behind keyboard when TextInput has focus?](http://stackoverflow.com/questions/29313244/how-to-auto-slide-the-window-out-from-behind-keyboard-when-textinput-has-focus) – Samuli Hakoniemi Apr 05 '16 at 06:59
  • Do you solve it? – Idan Sep 10 '19 at 12:51

0 Answers0