일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Python
- 상자 그림
- 다변량 분석
- 군집화 시각화 방법
- 날짜 시간 데이터 전처리
- 명목형 데이터
- 주성분 분석
- 시계열 상관 분석
- 데이터 종류에 따른 분석 방법
- 데이터 수집 및 전처리
- ARMA 모델링
- 계절성 모델
- 데이터의 차원 축소
- 시계열 특성을 고려한 이상치 탐지
- 시계열 모델링
- 주성분 줄이기
- Z-점수 기반 이상치 탐지
- R과 Python
- 최소-최대 정규화
- 상위포지션
- 지수평활법
- 데이터 분석 프로세스
- 선형 판별 분석 LDA
- 범주형 데이터
- ARIMA 모델링
- 다중상관분석
- 상관 분석
- 순서형 데이터
- Q-Q 플롯
- custom vision
Archives
- Today
- Total
me made it !
[React] 본문
반응형
import * as Location from "expo-location"
import React, { useEffect, useState } from "react";
import {View, Text, Dimensions, StyleSheet, ScrollView} from 'react-native';
const { width : SCREEN_WIDTH } = Dimensions.get('window');
export default function App() {
const [city, setCity] = useState("Loading...")
const [location, setLocation] = useState();
const [ok, setOk] = useState(true);
const ask = async() => {
const {granted} = await Location.requestForegroundPermissionsAsync();
if (!granted) {
setOk(false);
}
const {coords: {latitude, longitude}} = await Location.getCurrentPositionAsync({accuracy: 5});
const location = await Location.reverseGeocodeAsync(
{latitude, longitude},
{useGoogleMaps:false}
);
setCity(location[0].city);
};
useEffect(() => {
ask();
}, [])
return (
<View style={styles.container}>
<View style={styles.city}>
<Text style={styles.cityName}>{city}</Text>
</View>
<ScrollView
showsHorizontalScrollIndicator
pagingEnabled
indicatorStyle="white"
horizontal contentContainerStyle={styles.weather}>
<View style={styles.day}>
<Text style={styles.temp}>24</Text>
<Text style={styles.description}>cloudy</Text>
</View>
<View style={styles.day}>
<Text style={styles.temp}>24</Text>
<Text style={styles.description}>cloudy</Text>
</View>
<View style={styles.day}>
<Text style={styles.temp}>24</Text>
<Text style={styles.description}>cloudy</Text>
</View>
<View style={styles.day}>
<Text style={styles.temp}>24</Text>
<Text style={styles.description}>cloudy</Text>
</View>
<View style={styles.day}>
<Text style={styles.temp}>24</Text>
<Text style={styles.description}>cloudy</Text>
</View>
<View style={styles.day}>
<Text style={styles.temp}>24</Text>
<Text style={styles.description}>cloudy</Text>
</View>
<View style={styles.day}>
<Text style={styles.temp}>24</Text>
<Text style={styles.description}>cloudy</Text>
</View>
</ScrollView>
</View>
)
}
const styles = StyleSheet.create({
container:{
flex:1,
backgroundColor : "tomato",
},
city : {
flex : 1.2,
// backgroundColor: "blue",
justifyContent: "center",
alignItems: "center",
},
cityName: {
color : "black",
fontSize : 80,
fontWeight: "500",
},
weather : {
// backgroundColor : "blue",
},
day: {
width: SCREEN_WIDTH,
alignItems : "center",
// backgroundColor: "teal",
},
temp : {
marginTop : 50,
fontSize : 156,
},
description : {
marginTop : -10,
fontSize : 50
}
});
반응형
'TIL > React' 카테고리의 다른 글
[React] to-do list 만들기 (0) | 2023.09.05 |
---|---|
[React] 날씨 앱 만들기 (0) | 2023.09.05 |
[React] flex에 대하여 (반응형 레이아웃 만들기) (0) | 2023.09.04 |
[React] (0) | 2023.09.04 |
[React] Snack을 아시나요..? (0) | 2023.09.03 |