How to make a image resize use Nine-Blocks?

Sometimes we should use a image that size will be sometimes big and sometimes small, so we can not prepare so many images for it, so we can use a small image, and make the centre is a kind of pure colour, then use the method:

UIImage *image = [UIImage imageNamed:@"tree/tree_bottom"];
UIEdgeInsets bgEdgeInsets = UIEdgeInsetsMake(17, 17, 17, 17);
image = [image resizableImageWithCapInsets:bgEdgeInsets resizingMode:UIImageResizingModeTile];



to make many tiles to fill the big image.

so it can fix the issue perfectly.

Thanks,

Blues

你可能感兴趣的:(How to make a image resize use Nine-Blocks?)