ios - 如何向下平移以关闭键盘?

标签 ios user-interface react-native

在“消息”应用中,您可以“向下平移”,键盘将跟随触摸向下移动,直至其消失。

对于 React Native 来说,最好的解决方案是什么?

最佳答案

ScrollView组件有一个名为 keyboarddismissmode 的属性.

keyboardDismissMode

Determines whether the keyboard gets dismissed in response to a drag.

Cross platform

  • none (the default), drags do not dismiss the keyboard.
  • on-drag, the keyboard is dismissed when a drag begins.

iOS Only

  • interactive, the keyboard is dismissed interactively with the drag and moves in synchrony with the touch; dragging upwards cancels the dismissal. On android this is not supported and it will have the same behavior as 'none'.

我从未使用过此属性,但根据描述和 this answer ,我想这就是您要找的。

关于ios - 如何向下平移以关闭键盘?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51164284/

相关文章:

ios - 优化从相机胶卷中选取的图像以减小文件大小

ios - Swift 侧边栏菜单创建

user-interface - 窗口Ex : setting the background color to transparent

java - java 导入如何工作(swing)?

java - 如何在自己的线程中启动 JavaFX GUI

react-native - Axios 未处理的 promise 拒绝

ios - 将此日期字符串转换为 NSDate "2016-09-23T23:06:00+00:00"

iphone - 使用 AFNetworking 发布请求

WebStorm + React Native?

android - react native : Remove underline on TextInput for Android