9-patch image usage in android,
In many articles, 9.png has two areas: a scalable exhibition area and a content display area. It took only half a day to understand what is a scalable exhibition area and a content display area.
Share your understanding.
Is a blog:
Picture from: http://blog.csdn.net/greatstar/article/details/5936177
A 9.png image has four black lines or black spots on the top, bottom, and left. The general understanding is:
Line above: Area horizontally stretched.
Line on the left: vertical stretch area.
The line on the right and bottom shows the content display area and editable area. It is the area where the control is placed. Except for this area, nothing else can be placed.
For example:
<TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: background = "@ drawable/tt" android: text = "this is a test. "/>
If you move the line to the right to see the effect:
The text is displayed in the area on the right and bottom. (Here Is text. If other controls such as button are added, the text is also displayed here)