I know that this is an old thread, but for everyone who came across this after the release of iOS 5, it should be noted that from the Apple documentation it should be noted that the stretchableImageWithLeftCapWidth: topCapHeight: method is deprecated from iOS 5:
Deprecated UIImage Methods
Deprecated in iOS 5.0. Outdated. Use resizableImageWithCapInsets : instead, specify inserts with a cover so that the inner area is 1x1.
So, now that iOS 6 has been announced and will be available soon, any developer for iOS 5 and above should probably take a look at resizableImageWithCapInsets , which documentation can be found here:
UIImage class reference - resizableImageWithCapInsets
Just thought that I mentioned this to help developers who need an updated answer to this problem.
Evan K. Stone
source share