react-native-apex-textinput

apex react-native textinput library

Usage no npm install needed!

<script type="module">
  import reactNativeApexTextinput from 'https://cdn.skypack.dev/react-native-apex-textinput';
</script>

README

react-native-apex-textinput

顶点自定义文本输入控件

  • 1.0.5 改进 适配RN0.48版本和iOS11
  • 1.0.4 改进 适配RN0.47版本
  • 1.0.3 改进 iOS版本支持multiline={true}

Install

第一步(两种方式)

方式1

解压本文件夹到node_modules/react-native-apex-textinput

方式2

项目的package.json中配置

"dependencies": {
  "react-native-apex-textinput": "git+http://git.apexsoft.top/lvlin/react-native-apex-textinput.git#v1.0.5"
}

(rn0.45以下版本需用v1.0.3)

第二步

方式1

在项目文件下运行

npm install react-native-apex-textinput
react-native link react-native-apex-textinput
iOS安装说明:

以下文件需要手动添加到项目工程内:

需添加的头文件 = RCTTextField.h和RCTTextFieldManager.h、RCTTextView.h和RCTTextViewManager.h(0.47版本还要添加RCTUITextField.h、RCTBackedTextInputViewProtocol.h、RCTTextInput.h)
  • 1 在React.xcodeproj工程中的Libraries目录中添加Text目录,在Text目录中添加“需添加的头文件” alt tag alt tag alt tag

  • 2 在React.xcodeproj工程中React TARGETS中的Build Phases中Copy Headers中添加“需添加的头文件”

  • 3 在React.xcodeproj工程中React TARGETS中的Build Phases中Headers->Project中添加“需添加的头文件” alt tag

  • 4 在项目中添加"node_modules/react-native-apex-textinput/ios/"目录中的RNTextInputImages.xcassets文件 alt tag

  • 5 如果react-native版本低于0.39,执行下面步骤,在 Header Search Paths 中添加 $(inherited) $(SRCROOT)/../../react-native/React/** $(SRCROOT)/../../react-native/Libraries/Text/** alt tag

方式2

iOS cocoapods本地安装,在Podfile根据项目需求添加

pod "RNTextInput", :path => '../node_modules/react-native-apex-textinput/ios'
执行 pod install

例子

<TextInput customInputType='login'
    customReturnKeyText='登录'
    multiline={true}
    inputAccessorys={['->', 'close']}
    closeButtonHidden={false}
    placeholder='请输入交易密码'/>