簡體   English   中英

Android Studio 的 Vector Asset 導入的變化

[英]Change in Android Studio's Vector Asset import

伙計們,我注意到當我在最近版本中使用 Android Studio 的矢量資產導入導入SVG時,我得到的圖像比以前更小。 下面是一個例子:

之前導入的圖片:

<vector android:height="24dp" android:viewportHeight="240"
    android:viewportWidth="240" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#d82727"
        android:pathData="m220,194c0,-7.236 -2.487,-13.342 -7.688,-18.312 -4.975,-4.975 -11.081,-7.688 -18.312,-7.688s-13.342,2.487 -18.312,7.688 -7.688,11.306 -7.688,18.312c0,7.236 2.487,13.342 7.688,18.312 5.201,5.201 11.306,7.688 18.312,7.688 7.236,0 13.342,-2.487 18.312,-7.688 5.201,-4.975 7.688,-11.081 7.688,-18.312m-17.642,-14.248 l5.88,6.106 -8.366,8.366 8.366,8.366 -5.88,5.88 -8.366,-8.366 -8.366,8.366 -6.106,-5.88 8.366,-8.366 -8.366,-8.366 6.106,-6.106 8.366,8.366z" android:strokeWidth="2.261"/>
</vector>

舊圖

現在導入的相同圖像:

<vector android:height="24dp" android:viewportHeight="240"
    android:viewportWidth="240" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#d82727"
        android:pathData="m223,201c0,-5.287 -1.817,-9.748 -5.617,-13.38 -3.635,-3.635 -8.096,-5.617 -13.38,-5.617s-9.748,1.817 -13.38,5.617 -5.617,8.261 -5.617,13.38c0,5.287 1.817,9.748 5.617,13.38 3.8,3.8 8.261,5.617 13.38,5.617 5.287,0 9.748,-1.817 13.38,-5.617 3.8,-3.635 5.617,-8.096 5.617,-13.38m-12.89,-10.41 l4.296,4.461 -6.113,6.113 6.113,6.113 -4.296,4.296 -6.113,-6.113 -6.113,6.113 -4.461,-4.296 6.113,-6.113 -6.113,-6.113 4.461,-4.461 6.113,6.113z" android:strokeWidth="1.652"/>
</vector>

新圖片

我不知道這個變化是什么時候發生的,但是有沒有辦法像以前一樣導入類似比例的圖像? 我以某種方式不喜歡編輯/導入所有圖像以獲得像以前一樣的結果。

預覽部分只是一個演示。 你的頭像沒變

但是你可以給向量指定寬度和高度,這對你有幫助嗎?

<vector android:height="{custom size}" android:viewportHeight="240"
        android:viewportWidth="240" android:width="{custom size}" 

xmlns:android="http://schemas.android.com/apk/res/android">
        <path android:fillColor="#d82727"
            android:pathData="m223,201c0,-5.287 -1.817,-9.748 -5.617,-13.38 -3.635,-3.635 -8.096,-5.617 -13.38,-5.617s-9.748,1.817 -13.38,5.617 -5.617,8.261 -5.617,13.38c0,5.287 1.817,9.748 5.617,13.38 3.8,3.8 8.261,5.617 13.38,5.617 5.287,0 9.748,-1.817 13.38,-5.617 3.8,-3.635 5.617,-8.096 5.617,-13.38m-12.89,-10.41 l4.296,4.461 -6.113,6.113 6.113,6.113 -4.296,4.296 -6.113,-6.113 -6.113,6.113 -4.461,-4.296 6.113,-6.113 -6.113,-6.113 4.461,-4.461 6.113,6.113z" android:strokeWidth="1.652"/>
    </vector>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM