Вы должны просто поместить этот код в "cellForRowAtIndexPath"
. Для отключения ячейки выберите: (при нажатии на ячейку)
cell.selectionStyle = UITableViewCellSelectionStyleNone;
Для включения ячейки: (при нажатии на ячейкуячейка)
cell.selectionStyle = UITableViewCellSelectionStyleBlue;(By Default)
cell.selectionStyle = UITableViewCellSelectionStyleGray;
Если вы хотите задать свой собственный цвет, тогда в cellForRowAtIndexPath "
if (cell==nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
UIView *v = [[[UIView alloc] init] autorelease];
v.backgroundColor = [UIColor redColor];
cell.selectedBackgroundView = v;
}
Всего наилучшего.