-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnimated_list.js
68 lines (62 loc) · 1.7 KB
/
Animated_list.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
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Switch,
} from 'react-native';
import Button from './Button';
export default class Animated_list extends Component {
//构造
constructor(props)
{
super(props);
this.state = {
eventSwitchIsOn : false,
};
}
render() {
let {route, navigator} = this.props;
switch(route.id){
case 'Animated' :
return (
<View style={styles.btnList}>
<Button text="动画1" onPress={() => navigator.push({title:'动画1',id:'Animated1'})} />
<Button text="动画2" onPress={() => navigator.push({title:'动画2',id:'Animated2'})} />
<Button text="动画3" onPress={() => navigator.push({title:'动画3',id:'Animated3'})} />
<Button text="动画4" onPress={() => navigator.push({title:'动画4',id:'Animated4'})} />
<Switch
onTintColor='red'
thumbTintColor='green'
tintColor='blue'
disabled={false}
// style={{
// marginBottom: 10,
// borderColor: '#875',
// borderWidth: 1,
// }}
value={this.state.eventSwitchIsOn}
onValueChange={
(value) => this.setState({eventSwitchIsOn: value})
}
/>
</View>
);
break;
default :
return false;
}
}
}
const styles = StyleSheet.create({
content : {
flex : 1,
backgroundColor : 'green',
},
btnList : {
flex : 1,
justifyContent: 'center',
alignItems: 'center',
},
});