-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTopTitle.js
54 lines (50 loc) · 1.04 KB
/
TopTitle.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
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
export default class TopTitle extends Component {
render() {
let {title, onPress} = this.props;
return (
<View style={styles.topBox}>
<View style={styles.sideBox}>
<TouchableHighlight style={styles.btn} onPress={onPress}>
<Icon name="chevron-left" size={20} color="#888" />
</TouchableHighlight>
</View>
<View style={styles.middleBox}>
<Text>{title}</Text>
</View>
<View style={styles.sideBox}>
</View>
</View>
);
}
}
var styles = StyleSheet.create({
topBox : {
height : 40,
flexDirection : 'row',
borderWidth : 1,
borderColor : '#ddd',
},
sideBox : {
flex : 1,
height : 40,
justifyContent: 'center',
alignItems: 'center',
},
middleBox : {
flex : 8,
height : 40,
justifyContent: 'center',
alignItems: 'center',
},
btn : {
padding : 5,
},
});