Skip to content

Instantly share code, notes, and snippets.

@tongnews
Created March 17, 2016 08:58
Show Gist options
  • Save tongnews/ef652a6df3ff704b77b6 to your computer and use it in GitHub Desktop.
Save tongnews/ef652a6df3ff704b77b6 to your computer and use it in GitHub Desktop.
Testing react native js file
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
Image,
View,
ScrollView,
} = React;
var SampleApp = React.createClass({
render: function() {
return (
<View style={styles.container}>
<ScrollView>
<Image source={{uri: 'http://www.mycoolbackgrounds.com/backgrounds/24821/Toji%20Temple,%20Kyoto,%20Japan.jpg'}}style={styles.activity_img}/>
<Text style={styles.title}>
萤火之森圣地巡礼—再也不会期待没有你的夏天
</Text>
<Text style={styles.instructions}>
3月16日 星期六 (12天后)
</Text>
<Image source={{uri: 'http://www.mycoolbackgrounds.com/backgrounds/24821/Toji%20Temple,%20Kyoto,%20Japan.jpg'}}style={styles.activity_img}/>
<Text style={styles.title}>
萤火之森圣地巡礼—再也不会期待没有你的夏天
</Text>
<Text style={styles.instructions}>
3月16日 星期六 (12天后)
</Text>
<Image source={{uri: 'http://www.mycoolbackgrounds.com/backgrounds/24821/Toji%20Temple,%20Kyoto,%20Japan.jpg'}}style={styles.activity_img}/>
<Text style={styles.title}>
萤火之森圣地巡礼—再也不会期待没有你的夏天
</Text>
<Text style={styles.instructions}>
3月16日 星期六 (12天后)
</Text>
<Image source={{uri: 'http://www.mycoolbackgrounds.com/backgrounds/24821/Toji%20Temple,%20Kyoto,%20Japan.jpg'}}style={styles.activity_img}/>
<Text style={styles.title}>
萤火之森圣地巡礼—再也不会期待没有你的夏天
</Text>
<Text style={styles.instructions}>
3月16日 星期六 (12天后)
</Text>
</ScrollView>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
backgroundColor: '#FFFFFF',
},
title: {
fontSize: 16,
textAlign: 'left',
margin: 10,
color: '#111111',
},
activity_img:{
left: 0,
right: 0,
margin: 10,
height: 100,
},
instructions: {
textAlign: 'left',
color: '#666666',
marginLeft: 10,
fontSize: 15,
marginBottom: 5,
},
});
AppRegistry.registerComponent('SampleApp', () => SampleApp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment