tableViewCell调整其中自带的imageView的大小


//调整cell.imageView大小
let itemSize = CGSize(width: 22, height: 22) //希望显示的大小
UIGraphicsBeginImageContextWithOptions(itemSize, _: false, _: UIScreen.main.scale)
let imageRect = CGRect(x: 0.0, y: 0.0, width: itemSize.width, height: itemSize.height)
cell.imageView?.image?.draw(in: imageRect)
cell.imageView?.image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()



Loading Disqus comments...
Table of Contents