본문 바로가기

Android/참고

[Android] android:src VS app:srcCompat

app:srcCompat is the most foolproof method of integrating vector drawables into your app.Vector drawables allow you to replace multiple png assets with a single vector graphic, defined in XML. While previously limited to Lollipop and higher devices.

app : srcCompat는 벡터 드로어블을 앱에 통합하는 가장 확실한 방법입니다. 벡터 드로어블을 사용하면 여러 png 애셋을 XML로 정의된 단일 벡터 그래픽으로 대체 할 수 있습니다. 이전에는 Lollipop 이상의 기기에만 사용할 수 있었습니다.


As of Android Support Library 23.3.0, support vector drawables can only be loaded via app:srcCompat .
you need to add vectorDrawables.useSupportLibrary = true to your build.gradle file

Android Support Library 23.3.0에서 지원 벡터 드로어블은 app : srcCompat를 통해서만 로드할 수 있습니다. build.gradle 파일에 vectorDrawables.useSupportLibrary = true를 추가해야합니다.


android:src sets a drawable as the content of this ImageView.It will display in its original size. No automatic scaling.

android:src는 드로어블을 ImageView에 설정합니다. 원래 크기로 표시됩니다. 크기를 자동으로 조정하지 않습니다.


https://stackoverflow.com/questions/40624554/android-what-is-the-difference-between-appsrccompat-and-androidsrc