What should i use for better performance, nine-patch or drawable xml resource?
问题 What is the best way to set background for some view? For example 2 variants of backround: background with gradient, rounded corners and border background with just one color and rounded corners So which of variants would be better, nine-patch or drawable xml resource? 回答1: My guess is, NinePatch would be slightly faster in most cases. Here's what I found. GradientDrawable (the one used for rects in xml) uses this code to call through to Canvas which in turn uses native call leading to