본문 바로가기

android

[210805] android studio에서 google icon 사용하기

1. 아이콘 다운로드

https://fonts.google.com/icons 

 

Google Fonts

Making the web more beautiful, fast, and open through great typography

fonts.google.com

 

Google에서 제공하는 icon을 사용해서 벡터 리소스를 가져올 수 있다. 

 

사용 방법

1. build.gradle에 dependency를 추가한다.

android {
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
    }
}

dependencies {
    implementation 'com.android.support:appcompat-v7:23.2.0'
}

 

2. src>main>res 에서 마우스 오른쪽 버튼 클릭 > New > Vector Asset 선택

 

3. Clip Art: 옆에 있는 아이콘 버튼 눌러서 새로운 아이콘 추가 

 

4. UI가 정의된 xml에서 Image View를 사용해서 아이콘 사용

 

- Reference

https://developer.android.com/studio/write/vector-asset-studio 

 

다중 밀도 벡터 그래픽 추가  |  Android 개발자  |  Android Developers

Android 스튜디오에는 머티리얼 아이콘을 추가하고 SVG(Scalable Vector Graphic)와 PSD(Adobe Photoshop Document) 파일을 벡터 드로어블 리소스로 프로젝트에 가져올 수 있는 Vector Asset Studio라는 도구가 포함되어

developer.android.com