首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

iphone app 替图片添加边框

2012-06-27 
iphone app 为图片添加边框头文件中#import QuartzCore/QuartzCore.h当然Framework中需要有QuartzCore.f

iphone app 为图片添加边框
头文件中#import <QuartzCore/QuartzCore.h>
当然Framework中需要有QuartzCore.framework

UIImageView* leftView = [[UIImageView alloc] init];
    leftView.contentMode = UIViewContentModeScaleAspectFit;
    leftView.tag = AlbumTableViewCell_LeftImageView;


/*加边框*/
    leftView.layer.masksToBounds=YES;
    leftView.layer.cornerRadius=2.0; //圆角弧度
    leftView.layer.borderWidth=1.0; //边框宽
    leftView.layer.borderColor=[[UIColor grayColor] CGColor];

热点排行