-(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *tableCell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (tableCell == nil) {
tableCell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease] ;
[tableCell setSelectionStyle:UITableViewCellSelectionStyleGray];
}
}
Или вы можете попробовать это на cellForRowAtIndexPath
if (indexPath.row == selectedIndex)
{
Cell.LblDynamicCell.textColor=[UIColor whiteColor];
Cell.LblBackView.backgroundColor=[UIColor Black];
}
//LblDynamicCell,LblBackView objects declare in cellViewController class
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
selectedIndex = indexPath.row;
[self.ResultTbl reloadData];
}
Что такое таблицаCell ?? Где я должен объявить это? – gamersoul
попробуйте обновленный код .. –
kz .. есть ли какие-либо другие цветовые схемы, кроме синих и серых? как красный или черный? Я попытался использовать строку кода: "cell.selectionStyle = [UIColor colorWithWhite: 0.2 alpha: 1.0];" но он не работает: -/ – gamersoul