如何删除 React Native 中数字键盘上方的完成栏?

How to remove the Done Bar above the number-pad in React Native?

如何从键盘上删除这个栏?我到处看,我似乎无法找到答案。有人试图让它显示而不是隐藏。

非常感谢任何帮助。

当前代码:

<CustomInput
    keyboardType="number-pad"
    value={confirmationCode}
    onChangeText={(value) => setConfirmationCode(value)}
    placeholder={"••••••"}
    hidePlaceholder={true}
    maxLength={6}
    styleInput={styles.confirmationCodeStyleInput}
    autoFocusKeyboard={true}
    blurOnSubmit={false}
/>

谢谢

尝试使用 returnKeyType='none',它应该可以工作

我要回答这个问题,因为我在其他任何地方都没有看到它。

实现的方法是在<Input />组件中添加以下key/value:

inputAccessoryViewID="hideDoneButton"

然后在同一个渲染中的某处放置以下内容:

<InputAccessoryView nativeID="hideDoneButton"></InputAccessoryView>

这样做是用您自己的栏替换顶部输入附件栏。由于我们没有向它添加任何可视组件,因此它根本不会显示该栏。

干杯,我希望这能为其他开发者节省一些时间。