Custom animation in Android

前端 未结 6 2175
故里飘歌
故里飘歌 2020-12-13 14:12

I\'ve written a custom View. Now I want to do a little custom animation when the user touches it.

When I say custom, I mean I basically want to render e

6条回答
  •  -上瘾入骨i
    2020-12-13 14:54

    In addition to defining tweened animations in XML you can also define frame-by-frame animations (stored in res/drawable).

    
        
        
        
    
    

    Set the animation as the View background via setBackgroundResource.

    If you're looking to do something more complicated, take a look at the Canvas class. See the brief intro on how to draw with Canvas.

提交回复
热议问题