Created
August 13, 2017 06:36
-
-
Save chuyihuang/705f348b104f174af5b425698f37ad0b to your computer and use it in GitHub Desktop.
React Native workshop 2 snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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