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 |
Tags
- Javscript
- TextView
- 자바스크립트
- 스프링부트
- TypeScript
- 리액트
- Android
- Kotlin
- GoogleMaps
- React
- Java
- nodejs
- 코틀린
- scrollview
- button
- SpringBoot
- Linux
- 랜덤넘버
- array
- 구글맵스
- 랜덤번호
- 안드로이드
- stylesheet
- npm
- 오버라이딩
- JavaScript
- JS
- fragment
- RecyclerView
- Hook
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