-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomizeNaviBar.js
132 lines (115 loc) · 3.12 KB
/
CustomizeNaviBar.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/**
* Created by zhangzhenghong on 2017/11/17.
*/
import React, { Component } from 'react';
import PLSectionHeaderView from './PLSectionHeaderView'
import {
StyleSheet,
Text,
View,
Dimensions,
Image,
TouchableHighlight,
} from 'react-native';
import {
mapDispatchProps,
mapToState
} from './DataManager/ReduxManager'
import {
connect,
} from 'react-redux'
export default class CustomizeNavibar extends React.Component
{
constructor(props){
super(props)
}
componentDidMount() {
}
_setNativeProps(styless){
console.log('naviBar reaceive = ' + styless.opacity)
this._vi.setNativeProps({
style : styless.style
})
}
_sectionHeader(section){
return(
<SectionHeader ref={(header)=>this._sectionHeaderView=header}
style={styles.bannerStyle}>
</SectionHeader>
)
}
render(){
return(
<View style={styles.customizeNavibarStye} ref={(vi)=>this._vi=vi}>
<View style={styles.containViewStyle}>
<View style={{left: 10}}>
<Image style={{
width:40,
height:40,
borderRadius: 20,
}} source={require('./Image/1.jpg')}/>
</View>
{this._sectionHeader()}
</View>
</View>
// {/*<View style={styles.customizeNavibarStye} ref={(vi)=>this._vi=vi}>*/}
// {/*<View style={styles.containViewStyle}>*/}
// {/*<View style={styles.titleContainViewStyle}>*/}
// {/*<Text style={styles.titleStyle}>*/}
// {/*Main*/}
// {/*</Text>*/}
// {/*</View>*/}
// {/*</View>*/}
// {/*</View>*/}
)
}
}
const SectionHeader = connect(
mapToState,
mapDispatchProps,
)(PLSectionHeaderView)
const kScreenWidth = Dimensions.get('window').width
const kScreenHeight = Dimensions.get('window').height
const naviBarHeight = (kScreenHeight>=812?88:64)
const statusBarHeight = (kScreenHeight>=812?44:20)
const styles = StyleSheet.create({
customizeNavibarStye:{
backgroundColor:'white',
width:kScreenWidth,
height:naviBarHeight,
borderBottomWidth:0.5,
opacity:0,
position:'absolute',
borderBottomColor:'#cccccc',
top:0,
},
containViewStyle:{
left:0,
right:0,
bottom:0,
top:statusBarHeight,
flexDirection:'row',
alignItems:'center'
},
titleContainViewStyle:{
flex:1,
justifyContent:'center',
alignItems:'center',
width:150,
height:naviBarHeight,
},
titleStyle: {
fontSize:18,
textAlign:'center',
color:'#000000',
top:8,
fontWeight:'500',
},
bannerStyle:{
// position:'absolute',
top:20,
width:375,
height:40,
bottom:0,
}
})