According to the Android documentation, we know that the left and top black line define the stretchable area, and the bottom and right line define the content area.
It's easy to understand, but I found the below image named textfield_activated_holo_dark.9.png from android-17 framework. What is the purpose of the red colors in the lower-left, lower-right and top-right corners?
The Draw 9-patch tool is a WYSIWYG editor included in Android Studio that allows you to create bitmap images that automatically resize to accommodate the contents of the view and the size of the screen. Selected parts of the image are scaled horizontally or vertically based on indicators drawn within the image.
android.graphics.NinePatch. The NinePatch class permits drawing a bitmap in nine or more sections. Essentially, it allows the creation of custom graphics that will scale the way that you define, when content added within the image exceeds the normal bounds of the graphic.
A 9 patch image is a regular png (. PNG) image which is needful for android app developers where they require to wrap any content within a background image without pixelating the background image.
It's too support layout bounds.
See https://groups.google.com/d/msg/adt-dev/z_iLJWyDQdo/lf4sR6CRl2cJ for more info.
I believe this thread has some discussion on the same topic.
This has got something to do with setting layout bounds and I believe its not documented yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With