Please help me to understand on when i have to make decision to define 9 patch image. what i have understood is, 9-patch image is require only when i have defined my layout width and height with definite size but actually i don't have image of that size. let's say, i have set background size as 300*100 in my layout definition. but image i have 200*100, which is lesser size then what i need. in this case if i do define 9 patch image, will help to fit properly without compressing quality in all devices.
This where i used to 9 patch.
Now, what i want to understand is, does 9 patch image will scales on different screen resolution even if i have defined our layout definition as wrap content, match parent with no explicit value on width and height. does 9-patch will scale based on screen resolution?
What are exactly nine patch -
The 9-Patch is a modified PNG image that allows Android to determine how the image can be stretched to meet the specific layout during runtime(like fill_parent and wrap_content).
Common Usege -
1. Button backgrounds. (Default Android gray Button is a Nine-Patch)
2. Page backgrounds.
3. Splash screens.
Step-by-Step guides-
1. Edit NinePatch in Android Studio.
2. Best practice design usage here.
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