What is 9-Patch?
9-Patch images are stretchable, repeatable images reduced to their smallest size; users draw a right and bottom, solid black 1 pixel border to tell the system how to place the content within the image.
The 9-Patch is a PNG image with an added extension to the file name (filename.9.png), which allows the Android system to determine how the image can be stretched and contorted to meet the specific layout constraints.
The Android operating system reads the borders of these images to understand how to properly stretch the image itself and the content within the image such as text and effects.
9-Patch Theory
9-Patch gets its name from the fact that the overlay created breaks the image up into nine defined regions. Each region has specific stretch properties:
Corner Regions (1, 3, 7, 9)
These regions are fixed and nothing inside them will stretch.
Horizontal Sides (4, 6)
The pixels in these region will stretch vertically when necessary.
Vertical Sides (2, 8)
The pixels in these region will stretch horizontally when necessary.
Center (5)
The pixels in this region will stretch in both horizontal and vertical directions equally.
here is Google docs
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…