How to fix the problem with 9-image patches in android

I have an ImageView in my xml layout file. I set width for wrap_content and height for fill_parent. In the hierarchy viewer, the width is 2 px and the height is 120 pixels. But when I see this on the device, my image with 9 patches for the image does not stretch to 120 pixels. Could you tell me how I can eliminate this 9-patch image without stretching the error?

Thank.

+5
source share
1 answer

You need to set android: scaleType so that ImageView resizes the 9 patch. Usually you want to set it according to XY.

+7
source

All Articles