如何定位输入onFocus,使其不会留在键盘后面[React-Native]

时间:2016-06-17 20:08:41

标签: ios input reactjs react-native

我在react-native ios应用程序中遇到表单有困难。我希望我的输入将自己定位在onFocus上,以便在键盘打开时它们可见。我使用了 scrollResponderScrollNativeHandleToKeyboard ,这在其他问题上被推荐,但它确实是错误的。有时它有时会起作用。

inputFocused(refName) {
   let scrollResponder = this.scrollView.getScrollResponder();
   scrollResponder.scrollResponderScrollNativeHandleToKeyboard(
   ReactNative.findNodeHandle(this[refName]),
     270,
     true
   );
}

0 个答案:

没有答案