Gibt es eine Möglichkeit, das automatische Scrollen von UICollectionView
zu deaktivieren, wenn die Zelle fokussiert wird? Ich möchte den Inhalt Offset der Zelle manuell anpassen, wenn es in den Fokus kommt.Fokus-ausgelöste Scrolling von UICollectionView deaktivieren
I wan't den Inhalt im Offset zu aktualisieren:
- (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];
}
Das funktioniert aber da der Fokus Motor meine Zelle bewegt sich auch (scrollt es) ich mit Animation am Ende, die nicht glatt ist, es ist ein "Kick" am Ende davon.
Sorry, ich glaube, Sie meine Frage falsch verstanden. Ich habe etwas mehr Code gepostet. Was ich brauche, ist eine Sammlungsansicht, die den Inhaltsoffset nicht automatisch aktualisiert, wenn der Fokus von einer Zelle zur anderen übergeht. Ich möchte die Inhaltsoffset-Manipulation manuell selbst machen. – RaffAl