0
Apple 샘플 "PageControl"에서 UIPageControl을 사용하여 scrollview의 페이지 이동을 제어 할 수 있음을 알 수 있습니다.UITableView의 이동을 제어하기 위해 UIPageControl을 사용할 수 있습니까?
UITableView는 UIScrollView의 하위 클래스이므로 UIPageControl을 사용하여 "PageControl"과 같이 테이블 뷰 셀의 이동을 제어하려고합니다.
하지만 할 수있는 대리인 인터페이스를 찾을 수 없습니다.
질문은 다음과 같습니다
이 가능한이 작업을 수행하기 위해인가요? 그리고 왜 ?
감사
나를 내 질문에 대답하자, 프로그래밍프로그래밍 방식
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)newIndexPath {
NSIndexPath *scrollIndexPath;
if (newIndexPath.row + 20 < [timeZoneNames count]) {
scrollIndexPath = [NSIndexPath indexPathForRow:newIndexPath.row+20 inSection:newIndexPath.section];
} else {
scrollIndexPath = [NSIndexPath indexPathForRow:newIndexPath.row-20 inSection:newIndexPath.section];
}
[theTableView selectRowAtIndexPath:scrollIndexPath animated:YES
scrollPosition:UITableViewScrollPositionMiddle];
}