【问题标题】:How to make a custom text input for password in React Native?如何在 React Native 中为密码进行自定义文本输入?
【发布时间】:2019-08-14 08:46:33
【问题描述】:

如何在 React Native 中制作这样的密码类型的 TextInput?我希望输入像默认类型一样变成黑色圆圈,但我希望它根据每个输入之间的填充进行自定义。

【问题讨论】:

    标签: reactjs react-native react-native-textinput


    【解决方案1】:

    您可以使用已有的模块而无需制作它们。

    您可以使用react-native-pin-view

    我的使用方式

    import PinView from "react-native-pin-view";
    ...
              <PinView
                onComplete={this.onFinishCheckingCode.bind(this)}
                pinLength={4}
                inputBgColor="#888888"
                inputActiveBgColor="#ffd90d"
                buttonBgColor="#ffffff"
                buttonTextColor="black"
                keyboardViewStyle={{
                  borderColor: "#dfdfdf",
                  borderWidth: 1,
                  width: windowHeight / 11,
                  height: windowHeight / 11
                }}
                inputViewStyle={{ width: 18, height: 18, marginRight: 20 }}
              />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多