change color of UITableViewCell after reenabled userinteraction

不想你离开。 提交于 2019-12-13 04:31:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!