in iOS, does any UIImage support stretchableImageWithLeftCapWidth: , does that mean autoresize the uimmage?
in iOS, does any UIImage support stretchableImageWithLeftCapWidth: , does that mean autoresize the uimmage?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First, this is deprecated, replaced by the more powerful
resizableImageWithCapInsets:. However, that is only supported by iOS 5.0 and above.stretchableImageWithLeftCapWidth:topCapHeight:does not resize the image you call it on. It returns a new UIImage. All UIImages may be drawn at different sizes, but a capped image responds to resizing by drawing its caps at the corners, and then filling the remaining space.When is this useful? When we want to make buttons out of an image, as in this tutorial for the iOS 5 version.
The following code is a UIView
drawRectmethod which illustrates the difference between a regularUIImageand a stretchable image with caps. The image used forstretch.pngcame from http://commons.wikimedia.org/wiki/Main_Page.Output: