-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyScene.js
More file actions
59 lines (53 loc) · 2.28 KB
/
MyScene.js
File metadata and controls
59 lines (53 loc) · 2.28 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
import React, { Component,PropTypes} from 'react';
import {AppRegistry, StyleSheet, View, Text,Navigator,TouchableHighlight} from 'react-native';
export default class MyScene extends Component {
static get defaultProps() {
return {
title: 'MyScene'
};
}
render() {
return (
<View>
<Text style={styles.navigatorText}>Current Scene: {this.props.title}</Text>
<TouchableHighlight onPress={this.props.onForward } style={{backgroundColor:'#eeeeee'}}>
<Text style={styles.navigatorText}>Tap me to load the next scene</Text>
</TouchableHighlight>
<TouchableHighlight onPress={this.props.onBack } style={{backgroundColor:'#eeeeee'}}>
<Text style={styles.navigatorText}>Tap me to go back</Text>
</TouchableHighlight>
</View>
)
}
}
const styles=StyleSheet.create({
navigatorText:{
fontSize:12,color:'#ee3333',margin:10
},
navigator:{
alignItems:'center',
justifyContent:'center',//flex-start, center, flex-end, space-around, and space-between.
borderRadius:10,
backgroundColor:'#ffffff',
opacity:0.5,
shadowColor:'#ffffff',
},
});
MyScene.propTypes={
title:PropTypes.string.isRequired,
onForward:PropTypes.func.isRequired,
onBack:PropTypes.func.isRequired,
};
AppRegistry.registerComponent('MyScene', () => AwesomeProject);
// style={{color:'#ee0000'}}
// invalid props.style key'color' supplied to 'TouchableHighlight'
// valid keys:
// [
// width,height,top,left,right,bottom,minwidth,maxwidth,minheight,maxheight,
// margin,marginVertical,marginHorizontal,marginTop,marginBottom,marginLeft,marginRight,
// padding,paddingVertical,paddingHorizontal,paddingTop,paddingBottom,paddingLeft,paddingRight,
// borderWidth,borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth,
// position,flexDirection,flexWrap,justifyContent,alignItems,alignSelf,overflow,flex,flexGrow,flexShrink,flexBasis,zIndex,
// shadowColor,shadowRadius,transform,transformMatrix,decomposedMatrix,scaleX,scaleY,rotation,translateX,translateY,backfaceVisibility,backgroundColor,
// borderColor,borderTopColor,borderRightColor,borderLeftColor,borderBottomColor,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomLeftRadius,borderBottomRightRadius,borderStyle,opacity,elevation
// ]