重新启用用户交互后更改UITableViewCell的颜色 [英] change color of UITableViewCell after reenabled userinteraction
本文介绍了重新启用用户交互后更改UITableViewCell的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用中,我有一些菜单项,这些菜单项无法进行用户交互.
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.
此代码段运行一半:
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.
推荐答案
更改后您是否正在重画单元格?也许您可以尝试调用setNeedsLayout重绘单元格.
Are you doing any cell redrawing after the changes? Perhaps you can try calling setNeedsLayout to redraw the cell.
这篇关于重新启用用户交互后更改UITableViewCell的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文