Repository navigation
Expand file tree
/
Copy pathInput.js
More file actions
64 lines (58 loc) · 1.58 KB
/
Copy pathInput.js
File metadata and controls
64 lines (58 loc) · 1.58 KB
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
56
57
58
59
60
61
62
63
64
/*
Copyright © SuperMap. All rights reserved.
Author: Wang zihao
E-mail: zihaowang5325@qq.com
*/
import * as React from 'react';
import { View, StyleSheet, TextInput, Image, Platform } from 'react-native';
import * as Util from '../util/const_util';
const BGCOLOR = Util.USUAL_GREEN;
const BORDERCOLOR = Util.USUAL_SEPARATORCOLOR;
const WIDTH = 300;
export default class Input extends React.Component {
render() {
const imagePath = this.props.image ? this.props.image : require('../../image/input.png'); //add path
const isPassword = this.props.password ? this.props.password : false;
const placeholder = this.props.placeholder ? this.props.placeholder : 'place';
return (
<View style={styles.container}>
<View>
<Image style={styles.image} source={imagePath} />
</View>
<View style={{width:Util.USUAL_LINEWIDTH,backgroundColor: BORDERCOLOR }}/>
<TextInput style={styles.input}
secureTextEntry={isPassword}
placeholder={placeholder}
underlineColorAndroid='transparent'
placeholderTextColor={BORDERCOLOR} />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
width: WIDTH,
height: 40,
backgroundColor: BGCOLOR,
borderStyle: 'solid',
borderColor: BORDERCOLOR,
borderWidth: 1,
marginTop: 5,
},
image: {
height: 30,
width: 30,
margin: 5,
},
input: {
flex: 1,
...Platform.select({
android: {
padding: 0,
},
}),
},
});