테이블보기 내가 가지고있는 셀 배경색이 자주 변경됩니다. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
에 설정된 색상이 미세하지만 약간의 색상은 같은 테이블 뷰로드 한 후 설정됩니다 셀이 그것을 원래는 밖으로 스크롤 할 때 설정 한 것을 다시 되돌아갑니다 그 방법을 변경하면스크롤 후 TableView 색상 재설정
- (void) ChangeCellColorAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:currentCell inSection:0]];
cell.backgroundView.backgroundColor = [UIColor orangeColor];
}
전망. 내가 볼 수 없게 스크롤하면 어떻게 같은 색을 유지할 수 있는지 확인할 수 있습니다.
언제 어떻게이 메소드를 호출합니까? 셀을 만들거나 재사용 할 때 cellForRowAtIndexPath에서 호출해야합니다. – katzenhut
'cellForRowAtIndexPath'는 그 시점에 표시되는 셀만 업데이트합니다. 그 방법으로 배경을 설정하는 것이 좋습니다. –