美文网首页
UITableViewCell 自带imageView 的属性设

UITableViewCell 自带imageView 的属性设

作者: 无法触碰 | 来源:发表于2016-12-08 11:55 被阅读70次

CGSize itemSize = CGSizeMake(kSuitLength_V(49), kSuitLength_V(49));

UIGraphicsBeginImageContextWithOptions(itemSize, NO, UIScreen.mainScreen.scale);

CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);

[cell.imageView.image drawInRect:imageRect];

cell.imageView.image = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

cell.imageView.layer.cornerRadius = kSuitLength_H(49) / 2.0;

cell.imageView.layer.masksToBounds = YES;

cell.imageView.backgroundColor = kClearColor;

相关文章

网友评论

      本文标题:UITableViewCell 自带imageView 的属性设

      本文链接:https://www.haomeiwen.com/subject/gdfsmttx.html