Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 如何在airbnb的react native maps中的详图索引中使用TextInput?_React Native_React Native Maps - Fatal编程技术网

React native 如何在airbnb的react native maps中的详图索引中使用TextInput?

React native 如何在airbnb的react native maps中的详图索引中使用TextInput?,react-native,react-native-maps,React Native,React Native Maps,我想在调用中获取用户的输入,以便对其执行操作。但是在MapView.Callout中使用TextInput是没有用的,因为整个Callout都被按下了。如何实现这一点?调用callout的回调时,通过编程将焦点设置为TextInput。在调用中为TextInput指定一个ref 就像这样this.textInput=textInput}/> 现在,在callout的回调中只需编写。 this.textInput.focus() 侧注:确保绑定到调用this的回调,或在胖箭头函数中调用它,以便th

我想在调用中获取用户的输入,以便对其执行操作。但是在MapView.Callout中使用TextInput是没有用的,因为整个Callout都被按下了。如何实现这一点?

调用callout的回调时,通过编程将焦点设置为
TextInput
。在调用中为
TextInput
指定一个
ref

就像这样
this.textInput=textInput}/>

现在,在callout的回调中只需编写。
this.textInput.focus()

侧注:确保绑定到调用
this
的回调,或在胖箭头函数中调用它,以便
this.textInput.focus()中的
this
不会显示为未定义。
这是一个更干净的解决方案,您不必处理绝对样式和组件重叠

调用调用调用调用时,以编程方式将焦点设置为
TextInput
。在调用中为
TextInput
指定一个
ref

就像这样
this.textInput=textInput}/>

现在,在callout的回调中只需编写。
this.textInput.focus()

侧注:确保绑定到调用
this
的回调,或在胖箭头函数中调用它,以便
this.textInput.focus()中的
this
不会显示为未定义。 这是一个更干净的解决方案,您不必处理绝对样式和组件重叠