Created
January 5, 2017 07:16
-
-
Save suhanlee/7031743e2afffcfe37a6ced3677c4f34 to your computer and use it in GitHub Desktop.
React-native layout exam1
This file contains hidden or 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 { StyleSheet, AppRegistry, Text, TextInput, View } from 'react-native'; | |
| class Hello extends Component { | |
| render() { | |
| return ( | |
| <View style={styles.layout}> | |
| <Text>번호를 입력하세요</Text> | |
| <View style={{width: 200, height: 50, backgroundColor: 'skyblue'}}> | |
| <TextInput style={styles.item} | |
| placeholder="Type here" | |
| /> | |
| </View> | |
| </View> | |
| ); | |
| } | |
| } | |
| const styles = StyleSheet.create({ | |
| layout: { | |
| flex: 1, | |
| flexDirection: 'column', | |
| justifyContent: 'center', | |
| alignItems: 'center' | |
| }, | |
| item: { | |
| flex: 1, | |
| backgroundColor: 'skyblue', | |
| } | |
| }); | |
| // App registration and rendering | |
| AppRegistry.registerComponent('Hello', () => Hello); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment