gpt4 book ai didi

android - returnKeyType = "next" react native 问题

转载 作者:太空宇宙 更新时间:2023-11-03 13:09:48 33 4
gpt4 key购买 nike

我在 TextInput 组件中使用 returnKeyType = "next",但它的工作方式类似于 returnKeyType="go",而不是移动到下一个文本输入字段。

我们如何使用键盘上的“下一个”按钮从一个文本输入字段移动到下一个文本输入字段?

最佳答案

您需要使用如下引用将焦点设置在下一个文本字段上:

<View style={{flex:1}}>
<TextInput style={{height:40}}
placeholder="First TextField Input"
placeholderTextColor="#DCDCDC"
returnKeyType="next"
onSubmitEditing={()=>this.secondTextInput.focus()}/>
<TextInput style={{height:40}}
placeholder="Second TextField Input"
placeholderTextColor="#DCDCDC"
returnKeyType="go"
ref={(input)=>this.secondTextInput = input}/>
</View>

关于android - returnKeyType = "next" react native 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48301596/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com