Wednesday, September 1, 2010

Border and Rounded corners the UIImage

To border the UImage is Simple way

Bofore adding the Code import QuartzCore  (#import <QuartzCore/QuartzCore.h>)

UIImage *MyImage=[UIImage imageNamed: @"baby.jpg"];

MyImage.layer.borderColor = [UIColor lightGrayColor].CGColor;


MyImage.layer.borderWidth = 2.0;
To add Corner radius for the same image just add below two lines

MyImage.layer.cornerRadius = 10.0;

MyImage.layer.masksToBounds = YES;

1 comment:

  1. UIImage does not have a layer property. You might want to update your example to UIImageView instead as that is probably what you meant to use...

    ReplyDelete