UIImage has a method called ‘stretchableImageWithLeftCapWidth’ which scales an image horizontally without scaling the ‘caps’.
Is there a way to do this vertically as well? Or even horizontal and vertically?
The SDK doesn’t show me any method which might do this. Google doesn’t give any help either, but maybe I’m searching for the wrong words.
The actual method is
and it supports stretching (not scaling, the two are different concepts) in any direction.
If you want to stretch only vertically then set the
leftCapWidthto zero, to stretch only horizontally then set thetopCapHeightto zero. And to stretch in both directions set both appropriately.