I have an image in a custom cell. Is there any api to add a gray border to an image?
Thanks in advance!
If you are on iPhone OS 3.0, you can use the borderWidth and borderColor properties of your image view's CALayer to add a border over the image, as follows:
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 4-pixel-wide border with a fully opaque color having RGB values midway between white and black.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With