If you are on iPhone OS 3.0, you can use the borderWidth and borderColor properties for your CALayer image to add a border above the image, as shown below:
imageView.layer.borderWidth = 4.0f; CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); CGFloat values[4] = {0.5, 0.5, 0.5, 1.0}; CGColorRef grey = CGColorCreate(space, values); imageView.layer.borderColor = grey; CGColorRelease(grey); CGColorSpaceRelease(space);
This creates a border of 4 pixels wide with a fully opaque color having RGB values ββhalfway between white and black.
source share