UIImageView 设置 圆角

来源:互联网 发布:python line.split 编辑:程序博客网 时间:2024/05/22 17:42

导入库以及引用头文件:QuartzCore.FrameWork,以及#import<QuartzCore/QuartzCore.h>;

UIImageView * roundedView = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"wood.jpg"]];// Get the Layer of any viewCALayer * l = [roundedView layer];[l setMasksToBounds:YES];[l setCornerRadius:10.0];
下面这个在网上找的还没试过:
+(UIImage *)imageWithContentsOfFile:(NSString *)file cornerRadius:(NSInteger)...