uitableview - Updating frame of UITableViewCell Subview with AutoLayout -


i using auto layout. have uiview subview custom uitableviewcell. in cellforrow i'd set frame of uiview in cell row.

here's have:

uiview *bar; -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {                bar = (uiview *)[cell.contentview viewwithtag:2];                [bar setframe:cgrectmake(bar.frame.origin.x,                                          bar.frame.origin.y,                                                          10,                                       bar.frame.size.height)];  } 

if turn auto layout off, works. how can accomplish using auto layout? i've searched thoroughly , haven't found solution.

you can using storyboard or interface builder create uiview in tools, , use constraints desired size of view.

autolayout can done programmatically i've seen it's annoying. best way autolayout using visual building tools.

check out uitableviewcell xib stackoverflow posts see how go that. hints nib:

[self.tableview registernib:[uinib nibwithnibname:@"customtableviewcell" bundle:nil] forcellreuseidentifier:@"customcellidentifier"]; 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -