NinePatchDrawable
NinePatchDrawable is a type of drawable used in the Android framework to render and scale bitmap images defined as nine-patch assets. A nine-patch image is a PNG file whose name ends with .9.png and includes a one-pixel border that encodes how the image can be stretched and where content should be placed. The top and left borders mark stretchable areas, while the bottom and right borders specify the content padding. This enables the central region to stretch while the corners and edges retain their shape, ensuring UI elements such as buttons and panels scale cleanly across different sizes and screen densities.
As a subclass of Drawable, NinePatchDrawable renders a bitmap according to the patch information and handles
Creation and usage typically involve providing a properly prepared .9.png asset located in the app’s resources
See also: Drawable, NinePatch, 9-patch creation tools, ShapeDrawable, VectorDrawable.