头文件中#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];
当然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];
本文详细介绍了如何在Objective-C中使用UIImageView进行属性设置,包括设置内容模式、圆角、边框宽度和颜色,以及如何添加边框,提供了一个完整的实例供开发者参考。
2435

被折叠的 条评论
为什么被折叠?



