有没有一种方法可以禁用细胞聚焦时自动滚动UICollectionView
?我想在调整焦点时手动调整单元格的内容偏移量。禁用聚焦触发滚动的UICollectionView
我wan't更新内容偏移:
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
{
[coordinator addCoordinatedAnimations:^
{
[UIView animateWithDuration:[UIView inheritedAnimationDuration]
animations:^
{
// Move next focused cell.
if ([context.nextFocusedView isKindOfClass:[YBZEventCollectionViewCell class]])
{
UICollectionViewCell *cell = (UICollectionViewCell *)context.nextFocusedView;
CGPoint offset = CGPointMake(CGRectGetMinX(cell.frame), 0.0f);
[_collectionView setContentOffset:offset];
}
}];
} completion:nil];
}
这工作,但由于焦点引擎也移动我的手机(滚动它)我最终的动画是不光滑,有“踢”在它的结尾。
对不起,我想你是误会我的问题。我发布了更多的代码。我需要的是有一个集合视图,当焦点从一个单元格移动到另一个单元格时,不会自动更新内容偏移量。我想自己手动执行内容偏移操作。 – RaffAl