Peter
Peter

Reputation: 815

9patch (nine-patch) image does not stretch /scale properly

Dear Fellow Developers,

I've ran into the problem shown in the attached picture. We have been trying to tweak the dropdown menu's 9patch image provided by a graphics designer, but could not get it to work. The black stretch markers are not being hidden, and Android does not stretch it the way we would expect.

The device is a Nexus 7. We have tried several various image sizes, but none seemed to work. I am also attaching a copy of the 9patch.

What could be wrong?!

This happens:

The symptom

Here is the 9patch

Upvotes: 0

Views: 764

Answers (1)

Dreagen
Dreagen

Reputation: 1743

If the image has been created in a normal image editor rather than the android 9 patch tool, it could be just that its not done exactly right.

The image must have a 1px transparent border other than where the black lines are. Make sure its completely transparent and is only 1 px thick

Also I don't think you can have split lines (like you have down the left and right side of the image, I think they must be one solid line on each side)

Upvotes: 1

Related Questions