테이블 뷰를로드 할 때 행을 선택하려고합니다. 이 문제와 관련된 다른 스레드를 찾았지만 문제를 해결하지 못해 다시 묻습니다.프로그래밍 방식으로 UITableViewCell을 선택할 수 없습니다.
내 tableview에 5 행이 있습니다. 그리고 나는이 일을하고있다 :
if ([[dataSource objectAtIndex:indexPath.row] isEqualToString:self.status]) {
[self tableView:[self tableView] didSelectRowAtIndexPath:indexPath];
}
나는 또한 cell.selected = YES;
및 cell.highlighted = YES;
을 시도했습니다.
나는 custion 선택보기 위해 다음 코드를 사용하고 있습니다 :
UIView *customColorView = [[UIView alloc] init];
customColorView.backgroundColor = [UIColor colorWithRed:180/255.0
green:138/255.0
blue:171/255.0
alpha:0.5];
cell.selectedBackgroundView = customColorView;
프로그래밍 방식으로 행을 선택 도와주세요. 행을 탭하면 행이 선택되지만 프로그래밍 방식으로 선택할 수는 없습니다. 테이블 뷰 객체에 selectRowAtIndexPath를 호출
didSelectRowAtIndexPath는 대리자 메서드입니다. – Masa