ios - Adding a separator to UITableViewCell -
i'm build app (ios 8.0) whereas i've got uitableviewcontrolled built using autolayout , storyboards. tableview set static & grouped, , tableview separator set none.
i'm trying use code (called in viewwillappear:) add separator 2 other cells, reason, doesn't show:
// create separator tableview cells uiview *separatorviewtop = [[uiview alloc] initwithframe:cgrectmake(0.0f, 1.0f, self.fromcell.frame.size.width, 1.0f)]; uiview *separatorviewbottom = [[uiview alloc] initwithframe:cgrectmake(0.0f, 43.0f, self.fromcell.frame.size.width, 1.0f)]; separatorviewtop.backgroundcolor = [uicolor graycolor]; separatorviewbottom.backgroundcolor = [uicolor graycolor]; // add [self.fromcell.contentview addsubview:separatorviewtop]; [self.tocell.contentview addsubview:separatorviewbottom];
fromcell , tocell , connected in ib iboutlets.
could please take @ it? thanks!
if using xib custom cell, easy add these separator views in xib itself. think more flexible compare adding @ run time.
Comments
Post a Comment