Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 라즈베리파이
- 구글
- ReactNative
- Google JSON
- one-pan pasta
- 리액트네이티브
- Ionicons
- 원팬 파스타
- Parsing
- 원팬파스타
- RaspberryPi
- 안드로이드
- Google direction
- 파싱
- 리액트 네이티브
- one pot pasta
- 서버
- googlemap
- android studio
- Google Map
- json
- google api
- JSON parsing
- 구글 플레이스
- 구글 맵
- place picker
- Android
- 위치 끄기
- google places
Archives
- Today
- Total
날뛰는 코드
1. 리액트 네이티브 레이아웃 with Flexbox (react native layout with flexbox) 본문
https://youtu.be/Qb2a1uFSMvY
- flexbox로 디자인을 짤수있다
- 웹에서 배웠으면 이미 유용
-
import React from 'react';
import { StyleSheet, Text, View, ActivityIndicator } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.redView} />
<View style={styles.yellowView} />
</View>
);
}
}
// 오브젝트 만들어서 위에 뷰에 붙임
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
// alignItems: 'center',
// justifyContent: 'center',
},
redView:{
flex: 1, // 비율
backgroundColor:'red'
},
yellowView:{
flex: 1, //비율
backgroundColor:'yellow'
}
});
-alt + 마우스 커서하면 동시쓰기가능
-디폴트가 col 정렬
import React from 'react';
import { StyleSheet, Text, View, ActivityIndicator } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.redView} />
<View style={styles.yellowView} />
<View style={styles.redView} />
<View style={styles.yellowView} />
<View style={styles.redView} />
<View style={styles.yellowView} />
<View style={styles.redView} />
<View style={styles.yellowView} />
<View style={styles.redView} />
<View style={styles.yellowView} />
<View style={styles.redView} />
<View style={styles.yellowView} />
<View style={styles.redView} />
<View style={styles.yellowView} />
<View style={styles.redView} />
<View style={styles.yellowView} />
<View style={styles.redView} />
<View style={styles.yellowView} />
</View>
);
}
}
// 오브젝트 만들어서 위에 뷰에 붙임
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
//justifyContent: 'center',
justifyContent: 'flex-start',
alignItems: 'stretch',
flexDirection: 'row',
flexWrap:'wrap'
// css와 property가 다르다
// property 규칙: 두개의 단어를 대문자를 이용해서 이어주기
// 모든 value는 string,
// 쉼표를 사용해야함
// alignItems: 'center',
// justifyContent: 'center',
},
redView:{
//flex: 1, //비율
height:50,
width:50,
backgroundColor: 'red',
// alignSelf:'flex-start'
},
yellowView:{
//flex: 1, //비율
height:50,
width:50,
backgroundColor: 'yellow',
//alignSelf:'center'
}
});
'REACT NATIVE' 카테고리의 다른 글
3. Working WIth Icons (리액트 네이티브로 날씨앱 만들기) (0) | 2019.03.17 |
---|---|
2. Builing the Loading View (리액트 네이티브로 날씨앱 만들기) (0) | 2019.03.16 |
Comments