iOS上实现圆角图片

UIImageView自带

//圆角设置

imageView.layer.cornerRadius
 = 8;(值越大,角就越圆)

imageView.layer.masksToBounds
 = YES;

//边框宽度及颜色设置

[imageView.layer
 setBorderWidth:2];

[imageView.layer
 setBorderColor:[UIColor blueColor]];  //设置边框为蓝色


//自动适应,保持图片宽高比

imageView.contentMode
 = UIViewContentModeScaleAspectFit;

 

posted @ 2014-07-15 16:50  小小有  阅读(162)  评论(0编辑  收藏  举报