Vector graphics in Android

后端 未结 6 1891
遇见更好的自我
遇见更好的自我 2021-01-30 21:56

I\'m working on an application that displays someone else\'s database of images. The images they have are all vector graphics and can be converted to any format, however keepin

6条回答
  •  一向
    一向 (楼主)
    2021-01-30 22:16

    Creating Vector Drawables.


    I know this question is old, but I came across this same requirement and I'm happy to learn that Android 5.0 supports vector drawables now. You can use tag and path data to create vector drawables and it works like a charm on API-21. Here is an example that produces a vector image in the shape of a heart.

    
    
    
        
        
    
    

    The only problem I faced so far is that, it is not included in the support libs, and so you cannot make use of them in lower APIs. The wonderful thing is that, you can even animate vector drawables now. Here is an example.

    
    
        
            
        
    
    

    Read more about vector drawable animation here.

提交回复
热议问题