forked from alcat2008/react-native-auto-expanding-textinput
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.ios.js
55 lines (48 loc) · 1.23 KB
/
index.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View
} from 'react-native';
import AutoExpandingTextInput from 'react-native-auto-expanding-textinput';
class AutoExpandingTextInputExample extends Component {
_onChangeHeight(before, after) {
console.log('before: ' + before + ' after: ' + after);
}
render() {
return (
<View style={styles.container}>
<AutoExpandingTextInput
placeholder="height increases with content"
enablesReturnKeyAutomatically={true}
returnKeyType="done"
style={{
borderWidth: 2,
borderColor: 'black',
padding: 5,
marginHorizontal: 20,
fontSize: 16
}}
minHeight={40}
maxHeight={80}
onChangeHeight={this._onChangeHeight}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
borderWidth: 2,
}
});
AppRegistry.registerComponent('AutoExpandingTextInput', () => AutoExpandingTextInputExample);