objective c - Changing the BackgroundColor in a UITableViewCell has no effect on iOS 7.1 -
i working on little ios app derived master - detail template - of layout work has been done in xcode's storyboard.
however, trying alter background color of uitableviewcell depending on content.
my initial thought of doing :
- (void)tableview:(uitableview *)tableview willdisplaycell:(uitableviewcell *)cell forrowatindexpath:(nsindexpath *)indexpath { cell.backgroundcolor = [uicolor redcolor]; }
but had no effect on rendered cell in simulator. kept searching different approaches , tried several of them. illustration (in various flavors):
- (void)tableview:(uitableview *)tableview willdisplaycell:(uitableviewcell *)cell forrowatindexpath:(nsindexpath *)indexpath { cell.textlabel.backgroundcolor = [uicolor clearcolor]; uiview* bgview = [[uiview alloc] initwithframe:cell.bounds]; bgview.backgroundcolor = [uicolor greencolor]; [cell setbackgroundview:bgview]; }
still, no alter in rendered cell. admittedly desperate since final feature missing before can send beta out testers...
i appreciate additional hints.
best regards germany
edit: oddly enough, can't alter cell's color via setting of prototype cell in storyboard ..?
so got figured out:
it seems xcode messed caching/build process. after emptied deriveddata folder worked charm :
rm -rf ~/library/developer/xcode/deriveddata/*
i have never had problem before - or heard of it. now, i'll create sure clear folder first, before wasting hours investigating false problem.
i appreciate time guys invested help me out though !
objective-c uitableview ios7 uistoryboard uicolor
No comments:
Post a Comment