내 애플리케이션에서 컬렉션보기로 새로 고침 컨트롤을 사용합니다.UIRefreshControl with iOS7의 UICollectionView
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:[UIScreen mainScreen].bounds];
collectionView.alwaysBounceVertical = YES;
...
[self.view addSubview:collectionView];
UIRefreshControl *refreshControl = [UIRefreshControl new];
[collectionView addSubview:refreshControl];
iOS7에이 성가신 버그가 당신이 아래로 콜렉션 뷰를 끌어와 추한 스크롤 점프에 어떤 결과 아래로 지적 20-30를 들어, 시작 수직 contentOffset
변화를 새로 고칠 때 손가락을 해제하지 않을 때.
테이블에 UITableViewController
외부의 새로 고침 컨트롤을 사용하면 테이블에이 문제가 발생합니다. 그러나 그들을 위해 쉽게 _refreshControl
라고 UITableView
의 사유 재산에 UIRefreshControl
인스턴스를 할당하여 해결할 수 : 수동으로 처리 할 수있는 방법이 있어야합니다 그래서
@interface UITableView()
- (void)_setRefreshControl:(UIRefreshControl *)refreshControl;
@end
...
UITableView *tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds];
[self.view addSubview:tableView];
UIRefreshControl *refreshControl = [UIRefreshControl new];
[tableView addSubview:refreshControl];
[tableView _setRefreshControl:refreshControl];
그러나 UICollectionView
는 속성이 없습니다.
글쎄, 확실히 문제가 덜 분명합니다. 이 계산에 어떻게 도착했는지 말해 줄 수 있니? 그것은 꽤 자리에 표시되지 않습니다. 나는 3/2 대신 1.7 배를 곱하면 가장 좋은 결과를 얻을 수 있습니다. 그러나 1.7은 3/2보다 더 자의적이라고 느낀다. 필요한 정확한 조정을 찾아내는 것이 좋을 것입니다 ... –
좀 더 실험 한 후 3/2 정도가 맞았습니다. 그러나 그 분수는 어디에서 오는가? –
제스처 인식기의 변환 값과 contentInset 포인트를지나 스크롤 할 때 스크롤 뷰에서 이동 한 차이 사이의 비율을 보면 경험적으로 결정됩니다. 완벽하지는 않으며 iOS 6에서는 다른 가치라고 생각합니다. –