내 uitableviewcells 위에 '줄 구분 기호'를 수동으로 추가 할 수 있습니다. (기본 제공되지 않는 iOS에서는이를 위해 자르지 않습니다.) 그래서 UIViews의 배열이라고 _separatorLines, 내가 셀을 선택하면 그러나, 나는 다른 모든 세포를 원하는초기화 후 UITableViewCell의 ContentView를 변경할 수없는 이유
UIView *v = [_separatorLines objectAtIndex:indexPath.row];
[cell.contentView addSubview:v];
으로 cellForRowAtIndexPath ''내에있는 contentView '는 uitableviewcells 각 인덱스에서 하나의 UIView를 추가를 만들었습니다 라인 구분 기호가 빨간색으로 바뀝니다. 'didSelectRowAtIndexPath'에서 나는이 :
{
for(unsigned int i = 0; i < _rowsInSection-1; i ++)
{
//make all other rows have a red content view
if(i != indexPath.row)
{
NSIndexPath *I = [NSIndexPath indexPathForRow:i inSection:1];
UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:I];
UIView *separatingLineView = [_separatorLines objectAtIndex:I.row+1];
separatingLineView.backgroundColor = [UIColor redColor];
[cell.contentView bringSubviewToFront:separatingLineView];
[separatingLineView setNeedsDisplay];
[cell setNeedsDisplay];
[cell.contentView setNeedsDisplay];
}
}
[self setNeedsDisplay];
대신 내가 변화 uitableviewcells의있는 contentView를 볼 수 없습니다.