react-native-rn-textinputlayout
v1.0.2
Published
React native Android TextInputLayout
Readme
react-native-rn-textinputlayout
React Native Android module TextInputLayout.
Installation
npm install react-native-rn-textinputlayout --saveAdd it to your android project
- In
android/settings.gradle
...
include ':react-native-rn-textinputlayout'
project(':react-native-rn-textinputlayout').projectDir = new File(settingsDir, '../node_modules/android/react-native-rn-textinputlayout')- In
android/app/build.gradle
...
dependencies {
...
compile project(':react-native-rn-textinputlayout')
}- Register Module (in MainApplication.java)
import fr.bouyguestelecom.react.textinputlayout.TextInputLayoutPackager;
public class MainApplication extends Application implements ReactApplication {
......
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new TextInputLayoutPackager(),
......
);
}
......
}Example
'use strict';
import React, {
Component,
StyleSheet,
View,
TextInput
} from 'react-native';
import TextInputLayout from 'react-native-rn-textinputlayout';
class TextInputLayoutExample extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View>
<TextInputLayout>
<TextInput
placeholder='Name'
/>
</TextInputLayout>
<TextInputLayout>
<TextInput
placeholder='Password'
secureTextEntry={true}
/>
</TextInputLayout>
</View>
);
}
}
module.exports = TextInputLayoutExample;