【发布时间】:2011-02-12 16:46:41
【问题描述】:
我在更改 UILabel textColor 属性时遇到了一个小问题,它不会在 tableView didSelectRowAtIndexPath 方法中改变颜色我使用的是子类化的 customCell 和
我正在使用最新的 XCode4 GM 版本,想知道是否有其他人遇到过类似的情况 或者它可能是 xcode 版本中的错误
更新:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
NSIndexPath *indexPath = [tableView indexPathForCell:(HSCustomCellTF *)[[textField superview] superview]];
HSCustomCellTF *cell = (HSCustomCellTF *)[tableView cellForRowAtIndexPath:indexPath];
cell.keyLBL.textColor = [UIColor redColor];
cell.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"middleRowSelectedBG.png"]] autorelease];
tableView.userInteractionEnabled = NO;
return YES;
}
我想补充一点,我已经尝试过其他方法来达到结果,但没有运气,
我现在要试试willDisplayCell 方法,看看效果如何,谢谢你的帮助。
backgroundView 也正确更改,所以我正在访问单元格
【问题讨论】:
-
您能提供您尝试使用的代码吗?
标签: xcode ios uitableview uilabel