开发者

Using non simmetrical button background images

Id like to have a button shaped like a cloud. A 9 patch might be unusable since every time I create large borders around my cloud image, I get warnings about "bad patches" in the 9 patch tool. Using 1px borders gives weird results too 1. When replacing my resource with the btn_default from api 4 I get expected results, ruling out xml issues.

Without using 9 patches, wrap_content seems to work no more, growing the image to 100% width regardless of content. The 9 patch used is shown below.

I wouldn't mind some distortion, as long as content does not overflow. What would be the best solution?

I am not allowed to post images yet, apparently. Pl开发者_运维问答ease see zip containing screenshots and 9patch


Nice question.

I think there is no way to use those images and you might need to change them, but I will leave you some tips or things I would try:

  • To avoid overflow you will need to define the fill area. You can try just adding a fill area but not a scale area. If this works, you will have the cloud image with the text inside it.

  • Remember that 9patches scale up and not down.

  • Here is a link with a very good explanation of how everything works.

  • If nothing worked so far I would ask the designer to create a new image resource with a stretchable area. For instance, having cloud shape just in the corners.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜