开发者

Android onDraw() method and adding images

开发者 https://www.devze.com 2023-03-11 18:55 出处:网络
I have a view where i have overriden the onDraw() function for animation purposes. However there are some images i would to like to be static in the view do i have to draw these images in the onDraw()

I have a view where i have overriden the onDraw() function for animation purposes. However there are some images i would to like to be static in the view do i have to draw these images in the onDraw() func开发者_开发百科tion as well or can i apply these images via XML or something as a template?


Only override the onDraw() method of the views you want to draw by yourself. Otherwise you have to paint them yourself.


You can try a frame layout, which would have a child view for your static image and a child view for your animated images. Otherwise, I think you would have to redraw it each time. Also don't forget about other animation methods

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号