首先导入 #import <QuartzCore/QuartzCore.h>
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:imagefileName]];
imageView.layer.borderColor = [UIColor grayColor].CGColor;
imageView.layer.masksToBounds=YES;
imageView.layer.cornerRadius=1.0;