Когда я выбираю UITableViewCell и начинаю прокрутку до точки, где ячейки исчезают с экрана, разделители на этих ячейках исчезают, как только они появляются на экране.Отделители ячейки UITableView исчезают при выборе
Делегат:
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if(cell == nil){
if(Type == Scene){
Group *scene = [[appdata getScenes]objectAtIndex:lastRequestedPropertyPosition];
[selectedArray addObject:scene.id];
}else if(Type == Product){
Device *device = [[appdata getDevices]objectAtIndex:lastRequestedPropertyPosition];
[selectedArray addObject:device.id];
}
}else{
[selectedArray addObject:[NSNumber numberWithInt:cell.tag]];
}
}
Datasource:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"protoCell" forIndexPath:indexPath];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"protoCell"];
}
Group *group = [[appdata getScenes] objectAtIndex:indexPath.row];
if(group != nil){
[cell.textLabel setText:group.name];
}
cell.tag = group.id.intValue;
return cell;
}
Может кто-нибудь сказать, что пошло не так?
Благодаря
EDIT Используя это только делает сепаратор исчезают выбрать вместо того, чтобы просто держать там разделитель.
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
[self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if(cell == nil){
if(Type == Scene){
Group *scene = [[appdata getScenes]objectAtIndex:lastRequestedPropertyPosition];
[selectedArray addObject:scene.id];
}else if(Type == Product){
Device *device = [[appdata getDevices]objectAtIndex:lastRequestedPropertyPosition];
[selectedArray addObject:device.id];
}
}else{
[selectedArray addObject:[NSNumber numberWithInt:cell.tag]];
}
}
эта ссылка может помочь у http://stackoverflow.com/questions/19212476/uitableview-separator-line-disappears-when-selecting-cells-in-ios7 –