Skip to content

Instantly share code, notes, and snippets.

@chuyihuang
Created August 13, 2017 06:36
Show Gist options
  • Save chuyihuang/705f348b104f174af5b425698f37ad0b to your computer and use it in GitHub Desktop.
Save chuyihuang/705f348b104f174af5b425698f37ad0b to your computer and use it in GitHub Desktop.
React Native workshop 2 snippet
import React, { Component } from 'react';
import { Text, View } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View style={{flex: 1, flexDirection: 'column'}}>
<View style={{flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#eeeeee'
}}>
<Text>第一層</Text>
</View>
<View style={{flex: 2,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#dddddd'
}}>
<Text>第二層</Text>
</View>
<View style={{flex: 3,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#cccccc'
}}>
<Text>第三層</Text>
</View>
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment