2012-05-01 2 views
0
을 누르면

가능한 중복 :
disable scrolling in a UITableView (iPhone SDK 3.0)잠금 UITable는

내가 누를 때 버튼 후 UITAble의 스크롤을 고정 할 수 있는지 물어시겠습니까?를 거기에 어떤 코드가 있습니까?

아래 코드는 UITAble을 맨 위로 스크롤 한 다음 사용자가 더 이상 아래로 스크롤 할 수 없게하려는 것입니다.

- (IBAction)export:(id)sender{ 


    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; 
    [self.tableView scrollToRowAtIndexPath:indexPath 
          atScrollPosition:UITableViewScrollPositionTop 
            animated:YES]; 

} 

답변

3

아래 코드에서 접두사 self을 추가하는 것을 잊지 마십시오 ..

self.tableView.scrollEnabled = NO; 

희망이 당신에게 것입니다 ..