Android vector extracted from psd has blank preview

I tried to add a vector suitable for Android studio. Using the vector asset in Android studio, I imported the psd file, but it seems that there is a rendering problem, because the preview file and the XML result file are empty, check the   xml screenshot .

+4
source share
1 answer

In the screenshot there is no path file in the file. Therefore, nothing is drawn on the screen. I am showing the contents of an XML VectorDrawable file. Copy the contents into an empty xml file in the android studio and look at the figure blue on the screen.

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="600dp"
        android:height="600dp"
        android:viewportWidth="800.0"
        android:viewportHeight="800.0">

    <path
        android:pathData="M  162   8
        q    -07    00   -41    26
        q    -34    27   -50    64
        q    -25    59   -19   117
        q     07    70    53   121
        q     57    63   151    62
        q     87   -01   140   -66
        q     46   -55    48  -142
        q     01   -56   -34  -105
        q    -38   -52   -77   -70
        l    -29   -11
        q     16   -01    31   -02
        q     59   -01   119   -02






             "

        android:strokeLineCap="round"
        android:strokeColor="#f00f"
        android:fillColor="#00000000"
        android:strokeWidth="32"/>



</vector>
0
source

Source: https://habr.com/ru/post/1659504/


All Articles