xcode - Add border to a image in iphone -
I have an image in a custom cell. Is there an API for adding an image to a gray border?
Thank you in advance!
If you are on iPhone OS 3.0, you can add borders to the image CALayer's limit width and borderline properties can be used:
imageView.layer.borderWidth = 4.0F; CGColorSpaceRef Space = CGColorSpaceCreateDeviceRGB (); CGFloat value [4] = {0.5, 0.5, 0.5, 1.0}; CGColorRef Gray = CGColorCreate (Space, Value); ImageView.layer.borderColor = Gray; CGColorRelease (gray); CGColorSpaceRelease (space);
This creates a 4-pixel-wide border, which creates RGB values in the middle of white and black with a completely opaque color.
Comments
Post a Comment