I hava a UIButton. And for my button I want to set image with vertical gradient.

Button can change it width and height, so I need to make image stretchable. I found method like:
UIImage* myGradientImage = [UIImage imageNamed:@"gradientImage.png"];
UIImage* stretchImage = [myGradientImage
stretchableImageWithLeftCapWidth:20 topCapHeight:20];
When button width grows its stretched ok. But if height grows, gradient looks not very good.
Is there any possibility to set bottomCapHeight and topCapHeight together ? Or to say to image do not touch center of image ?
If you do
The height will stretch uniformly, which will look fine if you give a high-res original image.
If your rounded corners are in the image, however, this will make them non-circular. To get around that, supply your gradient image without rounded corners, then do