I don’t know if this is possible, but I guess it is.
I have a tableview with custom cells. These cells have a UIImageView as background. But because the size of the cell is relative I would like the image view to adapt its size.
This is now problem, I can define that in the Interface Builder. But I don’t want the corners of my image view to be scaled. Can I somehow assign a grid to the image view telling what now to resize, but only the “center” of that grid should be resized.
To make it a bit more clear, here is an example of what I mean:
http://dl.dropbox.com/u/3077127/example_grid.png
Best regards,
Paul Peelen
It is definitely possible. What you want is called “capping”. The documentation of UIImage has what you need. The function that you would want is:
You would call it on an instantiated image for your background and assign the result as your UITableViewCell background.