ios 按钮或图片框圆角处理

时间:2014-07-14 22:13:29   收藏:0   阅读:262

导入库头文件(重点)

#import <QuartzCore/QuartzCore.h>
 
//圆角设置
imageView.layer.cornerRadius = 6;
imageView.layer.masksToBounds = YES;
 
//边框宽度及颜色设置
[imageView.layer setBorderWidth:2];
[imageView.layer setBorderColor:[UIColor blueColor]];  //设置边框为蓝色
 
//自动适应,保持图片宽高比
imageView.contentMode = UIViewContentModeScaleAspectFit;

ios 按钮或图片框圆角处理,布布扣,bubuko.com

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!