ios - how can i keep image size in tableview? -
this when launch app
after click on cell images bigger
my code this
override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("mycell", forindexpath: indexpath) // configure cell... cell.imageview?.sd_setimagewithurl(nsurl(string: imagearray[indexpath.row]), placeholderimage:uiimage(named: "pin.png")) cell.imageview?.frame = cgrectmake(0, 0, 50, 50) return cell }
imagearray string of image urls. please help
thanks in advance
you can try use contant mode property:
imageviewobject.contentmode = uiviewcontentmode.scaletofill
or
imageviewobject.contentmode = uiviewcontentmode.scaleaspectfit
or
imageviewobject.contentmode = uiviewcontentmode.scaleaspectfill
Comments
Post a Comment