当我点击红色的Post按钮时,我想提交一个<TextInput>,一个<TouchableHighlight>.当文本输入被聚焦时,我完成输入并点击Post按钮,键盘关闭,但按钮没有记录点击.

我try 使用TextInput onBlur事件,但它没有给我touch 点的坐标,所以我不知道touch 点是否在按钮上方.

screenshot

推荐答案

您需要将属性keyboardShoulPersistTaps={true}添加到ScrollView中.

以下是docs人所说的:

keyboardShouldPersistTaps bool:

如果为false,则在

React-native相关问答推荐

错误:HostBody::get for prop NativeUnimoduleProxy中出现异常- Android虚拟设备(AVD)使用Expo测试React Native App时崩溃

Firebase身份验证Redux使用说明

嵌套的FlatList内的Incorrect Padding

使用 React Native 正确处理注销

FBSDK 和 LinkingManager 的 AppDelegate.m

React Native WebView onMessage 没有做任何事情

如何在 react-native 中设置 Onpress On Textinput

React Native - 当位置在Android上是绝对时视图消失

如何以编程方式在 react-native 中截屏

错误: Unable to determine the current character, it is not a string, number, array, or object in react-native for android

在react native 中出现Cannot read property 'pick算法rithm' of null错误

无法在 react native >= 0.60 中链接assets(字体)

XCode AppIcon 基于方案

Unexpected token on "export default const"

Port 8081 already in use, packager is either not running or not running correctly Command /bin/sh failed with exit code 2

ReactNative TextInput 不可见 iOS

仅链接字体的方法

如何在 React Native 中重复图案图像以创建背景?

如何在 React Native 中将图像放置在其他图像之上?

React 本机矢量图标在当前版本 0.60 上不起作用