将SVG转换为android动画矢量可绘制对象

问题描述 投票:1回答:1

如何将这个SVG文件转换为可绘制的动画矢量,以便Android在活动图像上显示。

SVG文件

<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#E31F64">
    <g fill="none" fill-rule="evenodd">
        <g transform="translate(1 1)" stroke-width="2">
            <circle stroke-opacity=".5" cx="18" cy="18" r="18"/>
            <path d="M36 18c0-9.94-8.06-18-18-18">
                <animateTransform
                    attributeName="transform"
                    type="rotate"
                    from="0 18 18"
                    to="360 18 18"
                    dur="1s"
                    repeatCount="indefinite"/>
            </path>
        </g>
    </g>
</svg>

我使用了一些在线工具进行转换,但它们只是创建了一个矢量而不是动画矢量这是向量

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

    <group
            android:translateX="1"
            android:translateY="1">
        <path
            android:fillType="evenOdd"
            android:strokeAlpha=".5"
            android:strokeWidth="2"
            android:pathData="M 18 0 C 27.941125497 0 36 8.05887450305 36 18 C 36 27.941125497 27.941125497 36 18 36 C 8.05887450305 36 0 27.941125497 0 18 C 0 8.05887450305 8.05887450305 0 18 0 Z" />
        <path
            android:fillType="evenOdd"
            android:strokeWidth="2"
            android:pathData="M36 18c0-9.94-8.06-18-18-18" />

    </group>
</vector> 

如何从中创建动画以显示旋转的椭圆。

谢谢

android android-animation svg-animate
1个回答
0
投票

使用ShapeShifter工具创建可绘制矢量的动画。这是一个非常基本的工具,但可以满足需要。

© www.soinside.com 2019 - 2024. All rights reserved.