2014-12-29 3 views
0

조립 라인에서 물건처럼 uicollectionviewcell을 이동하고 싶습니다. 지금 난 내가 메소드 호출 그 자체를 만드는 방법과 방법의 마지막에uicollectionview를 드래그하지 않고 방향을 유지하는 방법은 무엇입니까?

(void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition animated:(BOOL)animated 

를 사용합니다. 그러나 UICollectionViewCell 이동하고 중지하고 계속합니다.

답변

0

UICollectionView가있는 UIScrollView에서 상속, 그래서 당신은

// determine point, which you want to scroll 
CGPoint scrollPoint = CGPointMake(0, self.tableView.contentSize.height - self.tableView.frame.size.height); 
// scroll to it, with custom animation duration 
[UIView animateWithDuration:5 animations:^{ 
    [self.tableView setContentOffset:scrollPoint]; 
    // Also you can use scrollToItemAtIndexPath here instead of setContentOffset 
}]; 
을 사용할 수 있습니다
관련 문제