ios - How to align the UITableViewCell imageview to the edge of the UITableView -


hello using native uitableviewcell in uitableview. when set image of cell looks image view not aligned 0th x position in uitableviewcell. there gap or padding between uitableview & cell.imageview. did in cellforrowatindex

cgrect imgrect=cell.imageview.frame; imgrect.origin.x=0; cell.imageview.frame=imgrect; 

but still same. nothing changed. how can align cell image edge of table. please me. thanks

to align image view leading edge of content view, first need create custom uitableviewcell, follow below steps create subclass(see link create custom tableviewcell)

choose file > new > file (or press command-n).

on left of dialog appears, select source under ios.

select cocoa touch class, , click next.

in “subclass of” field, select uitableviewcell , create tableview subclass named "customtableviewcell".

open storyboard, in outline view, select table view cell.

open identity inspector. find field labeled class , select "customtableviewcell" list.

after tableviewcell done drag imageview , set constraints top, bottom , leading cell content view , keep constant 0. add height , width constraint imageview.

enter image description here


Comments