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