Skip to content

tzutzu858/svg-application

Repository files navigation

svg-application

SVG(Scalable Vector Graphics) 可縮放向量圖形
SVG格式是XML的一種,SVG檔案其實只是普通的文字檔案,
用一般的文字編輯器便可檢視或修改。





使用shapeshifter這個網站來編輯svg動畫

編輯好後export一個有寫動畫的xml檔



將SVG的XML檔放在drawable





主程式

public void animate2(View view) {
        final ImageView v = (ImageView) view;
        Drawable d = v.getDrawable();
        if (d instanceof AnimatedVectorDrawableCompat){
            AnimatedVectorDrawableCompat avd = (AnimatedVectorDrawableCompat) d;
            avd.start();

        }
        else if (d instanceof AnimatedVectorDrawable) {
            AnimatedVectorDrawable avd = (AnimatedVectorDrawable) d;
            avd.start();

        }
    }




SVG轉成XML

單純放靜態SVG的方法



About

增添svg動畫

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages