When to use 9 patch

Is there any Android developer documentation that says when a resource can be a 9 patch? In other words, is there a document that says something like the line โ€œthe following elements use 9-patch data, if availableโ€?

From the push and experience, I learned that the 9-patch schedule should be used to

  • application launch icons
  • used in the "Add to Home Screen" selection list for application widgets, wallpapers, and folders
  • wallpapers and when using BitMaps , for example. to canvas
  • view backgrounds

I was surprised to see that 9-patch data is ignored when drawings are used for menu icons and tab icons.

+4
source share
1 answer

9 patches are best used when you have an image that requires the width and / or height of the liquid.

Example. In my application, I had two custom buttons that were stretched to the bottom of the view. Since screen sizes may vary, I used 9 patches to allow the buttons to stretch correctly.

+3
source

All Articles