У меня есть рабочий стол на моем приложении iphone, и я реализую второй вид с помощью navigationController.Xcode UITableView Строка не подсвечивается при выборе
Но когда я пытаюсь выбрать ячейку на начальном представлении, она не отвечает, то есть нет выделения в синем, без выбора.
Может ли кто-нибудь предположить, что я, возможно, пропустил, или что отвечает за фактический выбор ячейки, когда пользователь ее удаляет?
ОК спасибо за ваши предложения - до сих пор не повезло. Вот мой код:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];
[cell setSelectionStyle: UITableViewCellSelectionStyleBlue];
UIView *selectionView = [[[UIView alloc] init] autorelease];
selectionView.backgroundColor =[UIColor redColor];
cell.selectedBackgroundView = selectionView;
}
// format text
cell.textLabel.font = [UIFont fontWithName:@"Arial" size:12];
cell.textLabel.text = [tableArray objectAtIndex:indexPath.row];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//NSUInteger row = indexPath.row;
//[DetailView selectRowAtIndexPath:indexPath animated:YES];
//UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath.row];
//[cell setSelectionStyle: UITableViewCellSelectionStyleBlue];
DetailView *detailView = [[DetailView alloc] initWithNibName:@"DetailView" bundle:nil];
[self.navigationController pushViewController:detailView animated:YES];
[DetailView release];
}
Сообщение код дружище .. –
Вы реализовали метод - (Недействительными) Tableview: (UITableView *) Tableview didSelectRowAtIndexPath: (NSIndexPath *) indexPath Сообщает делегат, что чем выбранная строка теперь выбрана. –