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
- Spring
- 글또10기
- xlsx-js-style
- 페이지네이션
- 배열중복요소제거
- meatadata
- Filter
- map
- 글또10기x코드트리
- 스크롤이벤트
- array
- 슬라이딩윈도우
- app.post
- 타입스크립트
- supabase 페이지네이션
- javascript
- generic
- 이진탐색
- reactnative
- react
- Next.js
- supabase auth
- 안드로이드빌드에러
- extends
- supabase authentication
- async
- 상속
- set
- TS
- interface
Archives
- Today
- Total
rhanziy
React Native - expo icon 사용하기 본문
expo를 설치했다면 자동으로 icon 라이브러리도 설치된다.
Fontisto 의 아이콘 스타일을 import 하고
import { Fontisto } from '@expo/vector-icons';
원하는 스타일의 아이콘태그로 사용할 수 있다.
단일 아이콘이라면 사이트에서 복사해다 쓰면 되는데, 나는 날씨에 맞게 아이콘을 표출하고싶어서 이렇게 작성했다.
<Fontisto name={icons[day.weather[0].main]} size={55} color="black" marginLeft={15} />
icon object 생성해서 weather API의 day데이터와 일치하는 아이콘 띄워주기.(물론 사이트에서 일일이 찾음)
const icons = {
"Clouds" : "cloudy",
"Rain" : "rains",
"Clear" : "day-sunny",
"Snow" : "snowflake",
"Atmosphere" : "cloudy-gusts",
"Drizzle" : "rain",
"Thunderstorm" : "lighting"
}
@expo/vector-icons directory
icons.expo.fyi
'React Native' 카테고리의 다른 글
React Native - edit기능 구현 중 too many re-renders(에러) (2) | 2023.10.10 |
---|---|
React Native - AsyncStorage, Alert (0) | 2023.10.10 |
React Native - TextInput component (0) | 2023.10.10 |
React Native - Touchable/Pressable component (0) | 2023.10.10 |
React Native - style 속성과 layout (0) | 2023.10.06 |
Comments