加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

React Native android:如何在按下“actionNext”键盘按钮后选择

发布时间:2020-12-15 20:12:05 所属栏目:百科 来源:网络整理
导读:我对 Android使用react native,我想用像这里的“next”选项编辑一堆TextInput(ios版本): https://github.com/facebook/react-native/pull/2149#issuecomment-129262565 我试过了: TextInput style = {styles.titleInput} returnKeyType = {"next"} autoFoc
我对 Android使用react native,我想用像这里的“next”选项编辑一堆TextInput(ios版本):
https://github.com/facebook/react-native/pull/2149#issuecomment-129262565

enter image description here

我试过了:

<TextInput
    style = {styles.titleInput}
    returnKeyType = {"next"}
    autoFocus = {true}
    placeholder = "Title"
    onSubmitEditing={(event) => { 
    this.refs.SecondInput.focus(); 
  }}
/>

<TextInput
ref='SecondInput'
style = {styles.descriptionInput}
multiline = {true}
maxLength = {200}
placeholder = "Description" />

但键盘是关闭和打开的,这很烦人.

从https://stackoverflow.com/a/4999372/1456487我明白,在本机Android应用程序,我会使用:

android:imeOptions="actionNext"

有没有办法做到这一点?

解决方法

这种能力在反应原生的.22中引入.

https://github.com/facebook/react-native/commit/ab12189f87d8e7fd84a4f1b92fa97e8894e984c7

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读