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 | 31 |
Tags
- Kotlin
- React
- Linux
- scrollview
- 자바스크립트
- 스프링부트
- array
- nodejs
- TypeScript
- GoogleMaps
- 랜덤번호
- 리액트
- npm
- 랜덤넘버
- TextView
- RecyclerView
- Android
- 코틀린
- Javscript
- stylesheet
- button
- fragment
- 구글맵스
- Java
- 오버라이딩
- Hook
- SpringBoot
- JavaScript
- JS
- 안드로이드
Archives
- Today
- Total
타닥타닥 개발자의 일상
react / flex 속성 이용하여 화면 비율 조정하기 (typescript) 본문
프로젝트 생성문
npx react-native init sample18 --template react-native-template-typescript
App.tsx
import React from "react";
import { StyleSheet, Text, View } from "react-native";
//flex : 크기 비율로 설정하는 것
export default function App(){
return (
<View style={style.container}>
<View style={style.caseOne}/>
<View style={style.caseTwo}>
<Text>두번째 화면</Text>
</View>
<View style={style.caseThree}/>
</View>
)
}
const style = StyleSheet.create({
container:{
flex:1,
width:300
},
caseOne:{
flex:1,
backgroundColor:'yellow'
},
caseTwo:{
flex:1,
backgroundColor:'blue'
},
caseThree:{
flex:8,
backgroundColor:'green',
height:200
}
})
실행화면
