I got an image,which is shorter than button's width, so I want to stretch the image's both sides to fit button's width but not stretch its center because there is text in center. What should I do to achieve that? Appreciate your suggestion!
stretch image's both sides but not center for uibutton
868 Views Asked by John At
2
Look for resizableImageWithCapInsets method of UIImage.
When 10 parameter is the margin of the text inside the image.
This creates a new UIImage that you can stretch.