对UIImageView的layer属性进行设置, 使UIImageView显示圆角。
UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
imageView.contentMode = UIViewContentModeScaleToFill; // 设置图片填充
imageView.image = [UIImage imageNamed:@"iamge.png"];
imageView.layer.cornerRadius = 8; // 圆角半径
imageView.layer.masksToBounds = YES; // 设置图片跟随layer圆角
imageView.layer.borderWidth = 2; // 设置边框宽度
imageView.layer.borderColor = [UIColor blueColor].CGColor; //设置边框为蓝色