react native vector icon 인스톨방법

악음·2022년 1월 20일
0

react native

목록 보기
2/2

포스팅하는이유

인스톨하기 빡쌤

참고한 싸이트

  1. 백터아이콘 공홈
  2. ios 설치법

설치법

npm install --save react-native-vector-icons

ios

  • 프로젝트>ios폴더>본은프로젝트명.xcworkspace 실행
  • 위 사진처럼 오른쪽 상단 리스트 오른쪽클린=>newGroup생성
  • 그룹명 Fonts으로 지움
  • 이제 node_modules에서 react-native-vector-icons을 찾는다.
  • 위에폴더로 들어가자
  • 위에 폴더로 들어가자
  • react-native-vector-ions/fonts 폴더안에있는 모든 폰트파일들을 방금전 생성한 그룹(Fonts)드레그엔 드롭을 하자 그럼 위화면과같은 알림창이뜬다.
    여기서 Copy items if needed을 체크
    create folder references 체크한뒤 finish클릭
  • 그런뒤 위에 스샷 구조로 들어가서 infomation property list 우클릭 addRow선택
  • 그럼 자동으로
  • 리스트를 보여준다.
  • 여기서 FontProvided bt application 을 클릭
  • 그런다음 해당 항목에 방금 Fonts 폴더에 추가한 폰트들을 하나하나 수작업으로 넣어준다.
  • 다 넣었다면 이제 커맨드 + 쉬프트 + k으로 clean build 실행
  • 여기까지 했다면 더쉬운 방법이 있다 그냥 info.plist 폴더로가서 dict 안에 코드를 복붙하면된다.
  • 그런다음 커맨드 쉬프트 k 으로 클린 실행 ㅇㅇ(xcode에서)
  • <dict>
       // 어쩌고 저쩌고 코드들
    	<key>UIAppFonts</key>
    	<array>
              <string>AntDesign.ttf</string>
              <string>Entypo.ttf</string>
              <string>EvilIcons.ttf&lt;</string>
              <string>Feather.ttf</string>
              <string>FontAwesome.ttf</string>
              <string>FontAwesome5_Brands.ttf</string>
              <string>FontAwesome5_Regular.ttf</string>
              <string>FontAwesome5_Solid.ttf</string>
              <string>Foundation.ttf</string>
              <string>Ionicons.ttf</string>
              <string>MaterialCommunityIcons.ttf</string>
              <string>MaterialIcons.ttf</string>
              <string>Octicons.ttf</string>
              <string>SimpleLineIcons.ttf</string>
              <string>Zocial.ttf</string>
              <string>Fontisto.ttf</string>
    	</array>
      // 어쩌고 저쩌고 코드들
      </dict>
      
  • 크고 아름다운 로켓이 나옴 ㅇㅋㅋ

android

  • vsCode에서

    위에 폴더 디렉토리로 이동
  • react.gradle 아래에 이쁘게
    apply from: "../../node_modules/react-native-vector-icons/fonts.gradle
    을 입력해준다.
  • 그다음 vscode에서 android 폴더로 접근한뒤 ./gradlew clean 입력한뒤
  • 루트 디렉토리로 돌아와서 npm run android 실행
  • 크고 아름다운 로켓트가 나옴 ㅋㅋ

후기

정리해보니 별로 안빡새보이긴하네 ㅋㅋ

profile
RN/react.js개발자이며 배운것들을 제가 보기위해서 정리하기 때문에 비속어 오타가 있을수있습니다.

0개의 댓글