-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.js
75 lines (63 loc) · 1.13 KB
/
index.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
/**
* Created by WittBulter on 16/9/5.
*/
import React, {Component} from 'react'
import {StyleSheet, View, Text, Image, TouchableHighlight, Dimensions} from 'react-native'
import Item from './item'
export default class Tabbar extends Component {
static propTypes = {
...View.propTypes,
style: View.propTypes.style
}
static Item = Item
// 构造
constructor (props){
super(props)
// 初始状态
this.state = {}
this.children = '2'
}
/**
*
* @param children {Array} children pages
*/
childrenView (children){
children.map((item, index) =>{
return (
<View key={`tabbar-item${index}`}>
{item}
</View>
)
})
}
/**
*
* @param children {Array} children pages footer
*/
footerBar (children){
children.map((item, index) =>{
return (
<TouchableHighlight>
<View>
<Image source={item.props.icon}/>
<Text>1</Text>
</View>
</TouchableHighlight>
)
})
}
render (){
return (
<View>
<View>
{/*{this.content}*/}
</View>
<View>
{this.footerBar(this.props.children)}
</View>
</View>
)
}
}
const styles = StyleSheet.create({
})