问题
in my app, i've some menupoints, that are disabled for userinteraction.
cell.userInteractionEnabled = FALSE;
after the login, i want to reenable some of these cells.
this snippet is working half the way:
NSIndexPath *editUsersPath = [NSIndexPath indexPathForRow:0 inSection:1];
[self.tableView cellForRowAtIndexPath:importPath].userInteractionEnabled = YES;
[self.tableView cellForRowAtIndexPath:importPath].accessoryType = UITableViewCellAccessoryDisclosureIndicator;
[self.tableView cellForRowAtIndexPath:importPath].textLabel.textColor = [UIColor blackColor];
but the last line of code is not working - the text is gray as before.
回答1:
Are you doing any cell redrawing after the changes? Perhaps you can try calling setNeedsLayout to redraw the cell.
来源:https://stackoverflow.com/questions/7967984/change-color-of-uitableviewcell-after-reenabled-userinteraction