美文网首页
iOS 调整UITableViewCell中的imageView

iOS 调整UITableViewCell中的imageView

作者: cydida | 来源:发表于2020-05-17 09:39 被阅读0次

            cell?.imageView?.image=UIImage(named:"图片名称")

            cell?.imageView?.layer.cornerRadius = 15

            cell?.textLabel?.text="New Group".localized()

            letitemSize =CGSize(width:30, height:30)

            UIGraphicsBeginImageContextWithOptions(itemSize, false, UIScreen.main.scale)

            letimageRect =CGRect(x:0, y:0, width: itemSize.width, height: itemSize.height)

            cell?.imageView?.image?.draw(in: imageRect)

            cell?.imageView?.image = UIGraphicsGetImageFromCurrentImageContext();

            UIGraphicsEndImageContext();

相关文章

网友评论

      本文标题:iOS 调整UITableViewCell中的imageView

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