在“消息”应用中,您可以“向下平移”,键盘将跟随触摸向下移动,直至其消失。
对于 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 ,我想这就是您要找的。p>
关于ios - 如何向下平移以关闭键盘?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51164284/