0
我有我自己的子類UITableViewCell
,我想在用戶按下單元格時進行自定義。在自定義UITableViewCell上奇怪的突出顯示
所以,我試圖重寫以下方法:
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
if (highlighted)
{
[self setBackgroundColor:[UIColor orangeColor]];
[self.optionLabel setTextColor:[UIColor whiteColor]];
}
else
{
[self setBackgroundColor:[UIColor clearColor]];
[self.optionLabel setTextColor:[UIColor orangeColor]];
}
[super setHighlighted:highlighted animated:animated];
}
如果我按住的細胞也能正常工作。但如果我快速點擊單元格,我的UITableView
會捕獲代表回調tableView:didSelectRowAtIndexPath:
,並且您看不到任何上述代碼生效。
有沒有人知道我在做什麼錯在這裏?