如何更改键盘中的"返回"按钮?

obi*_*obi 8 react-native

如何将返回按钮更改为ios的其他一些原生按钮?

现在它显示了灰色return按钮,而我希望它是蓝色的,其他文本如下例所示:

例:

在此输入图像描述

Sel*_*rim 12

您应该使用returnKeyType属性来确定返回键的外观

例:

 <TextInput style={{height:40}} 
       placeholder="Input"
       placeholderTextColor="#DCDCDC"
       returnKeyType="go"
 /> 
Run Code Online (Sandbox Code Playgroud)


Sir*_*rsh 6

2019 年更新:使用版本react-native 0.57接受的答案不再有效,因为“Go”不是可接受的值之一,请改用不带大写的“go”

实际react-native 0.57合同规定了以下枚举:

    /**
     * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call')
     * Determines how the return key should look.
     */
    returnKeyType?: ReturnKeyTypeOptions;
Run Code Online (Sandbox Code Playgroud)