Skip to content

Instantly share code, notes, and snippets.

@suhanlee
Created January 5, 2017 07:16
Show Gist options
  • Select an option

  • Save suhanlee/7031743e2afffcfe37a6ced3677c4f34 to your computer and use it in GitHub Desktop.

Select an option

Save suhanlee/7031743e2afffcfe37a6ced3677c4f34 to your computer and use it in GitHub Desktop.
React-native layout exam1
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