1

First I imported a svg file into the drawable folder using the android studio Vector Asset wizard successfully. In the layout file I added an ImageView used the file I previously imported as "src":

<ImageView
    android:id="@+id/idx_logo_btm"
    android:layout_width="75dp"
    android:layout_height="40dp"
    android:layout_centerHorizontal="true"
    android:src="@drawable/ic_logo_round" />

Then I scaled it to a bigger size, the image looks very well in the android studio Live Layout editor, but after deploying it to my device the image looks blurred just like bitmap. Is it because my device version is very low (4.4.2) or we can not scale svg?

Tonitang
  • 41
  • 7

2 Answers2

0

You have to use

    app:srcCompat="@drawable/ic_logo_round"

when supporting pre API 21 versions. More informations on this topic here: Android: What is the difference between app:srcCompat=" " and android:src=" "?

Peculator
  • 16
  • 2
-1

Try using android:scaleType="fitXY" or "centerCrop"

   <ImageView
        android:layout_width="75dp"
        android:layout_height="40dp"
        android:scaleType="fitXY"
        android:src="@drawable/ic_logo_round" />