在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):zbtang/React-Native-TextInputLayout开源软件地址(OpenSource Url):https://github.com/zbtang/React-Native-TextInputLayout开源编程语言(OpenSource Language):JavaScript 49.7%开源软件介绍(OpenSource Introduction):React-Native-TextInputLayoutPure js implemention material design TextInputLayout component for react-native, works on both android and ios. PreviewBuild and run the demo
UsageInstall from npm:
Integrate into your app:'use strict';
import React, {Component} from 'react';
import {StyleSheet, View, TextInput, Text} from 'react-native';
import {TextInputLayout} from 'rn-textinputlayout';
const EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
export default class TextInputLayoutDemo extends Component {
render() {
return (
<View style={styles.container}>
<TextInputLayout
style={styles.inputLayout}
checkValid={t => EMAIL_REGEX.test(t)}
>
<TextInput
style={styles.textInput}
placeholder={'Email'}
/>
</TextInputLayout>
<TextInputLayout style={styles.inputLayout}>
<TextInput
style={styles.textInput}
placeholder={'Password'}
secureTextEntry={true}
/>
</TextInputLayout>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: 100
},
textInput: {
fontSize: 16,
height: 40
},
inputLayout: {
marginTop: 16,
marginHorizontal: 36
}
}); ##Props
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论