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
- nodejs
- Android
- 자바스크립트
- 오버라이딩
- 랜덤번호
- stylesheet
- Linux
- Hook
- Kotlin
- RecyclerView
- JS
- React
- Java
- 리액트
- array
- button
- 랜덤넘버
- JavaScript
- 구글맵스
- npm
- TypeScript
- 코틀린
- 스프링부트
- fragment
- TextView
- 안드로이드
- SpringBoot
- Javscript
- scrollview
- GoogleMaps
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
}
})
실행화면
'코딩 기록 > react' 카테고리의 다른 글
Comments