Performance wise, what is typically better, using an image or a xml created shape as a drawable?

拈花ヽ惹草 提交于 2019-11-29 03:48:09

I just asked a similar question and it sounded like that using an image drawable is more efficient computationally than using a vector.(but i'm not expert so don't quote me on that)

It really depends on what your trying to set out to achieve in the first place. If you have completed creative assets that aren't going to change then it would make sense to create bitmaps etc from those.

However, if your prototyping or just beginning to flesh out your application where colours, sizes, transitions etc are likely to change quickly and often then bitmaps really aren't going to help your cause.

During development and up front i'd create a library of drawables i could re-use and update often. Then once everything is complete and signed off and if performance was important i'd revert to images.

If your organised enough you could perhaps use a theme or style to switch between the two.

Don't prematurely optomize. That's a really hard thing to know what will be better. I would just do it in xml since it would be easier to change.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!