ios - Prevent Image Overlaps in Table View Cell -
in cellforrowatindexpath
method have following code.
var cell = tableview.dequeuereusablecellwithidentifier("media item", forindexpath: indexpath) mediaitemtableviewcell let mediaitem = tweet!.media[indexpath.row] let imagedata = nsdata(contentsofurl: mediaitem.url) if imagedata != nil { cell.mediaimage = uiimage(data: imagedata!) } else { cell.mediaimage = nil } return cell
when run code image overlaps on tableviewcell
.
i love have image become thumbnail size , not overlap bounds of tableviewcell. best way approach this? i've tried resizing image image still becomes clipped. thanks.
have marked aspect-fit in uiimage , clipsubviews on mediaitemtableviewcell class in interfacebuilder? (attached image).