Android Vector筆記

先繪製網格,便於比對android

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:autoMirrored="true"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">

    <!-- 橫線 -->

    <path
        android:fillColor="#00000000"
        android:pathData="M0,0 L24,0"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M0,4 L24,4"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M0,8 L24,8"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M0,12 L24,12"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />


    <path
        android:fillColor="#00000000"
        android:pathData="M0,16 L24,16"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M0,20 L24,20"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M0,24 L24,24"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <!-- 豎線 -->

    <path
        android:fillColor="#00000000"
        android:pathData="M0,0 L0,24"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M4,0 L4,24"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M8,0 L8,24"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M12,0 L12,24"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />


    <path
        android:fillColor="#00000000"
        android:pathData="M16,0 L16,24"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M20,0 L20,24"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />

    <path
        android:fillColor="#00000000"
        android:pathData="M24,0 L24,24"
        android:strokeWidth="0.1"
        android:strokeColor="#33FFFFFF" />
</vector>

L和l的區別

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:autoMirrored="true"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">

    <path
        android:fillColor="#FF000000"
        android:pathData="M0,4 l4,4 4,-4z" />

    <path
        android:fillColor="#FF000000"
        android:pathData="M0,12 L4,16 8,12z" />
</vector>

如上圖所示,L後面跟絕對座標,l後面跟相對座標code

相關文章
相關標籤/搜索