使用layer将图片切成圆形图片

 UIImageView *headImageView=[[UIImageView alloc]initWithFrame:CGRectMake(30, 38, 57, 57)];

    headImageView.image=[UIImage imageNamed:@"add_netdisk_book.png"];

    headImageView.layer.masksToBounds=YES;

    headImageView.layer.cornerRadius=headImageView.bounds.size.width/2;

    headImageView.layer.borderWidth=1;

    headImageView.layer.borderColor=[UIColor blackColor].CGColor;

    [self addSubview:headImageView];

    [headImageView release];

 

posted @ 2016-02-24 15:24  曦曦果果  阅读(252)  评论(0编辑  收藏  举报