0

я один CollectionView и я хочу использовать анимацию в previouslyFocusedView и nextFocusedViewTVOS, UICollectionViewCell, анимация

вот моя первая часть от кода это работа

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 
{ 

    CCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath]; 




    [cell.lbl_My setText:[title_My objectAtIndex:indexPath.row]]; 


    return cell; 
} 

я не знаю, как назвать «ячейки» в этой части

- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context 
     withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator 
{ 




    if (context.previouslyFocusedView){ 

     //how to call the "cell" here 


    } else if (context.nextFocusedView){ 



    } 

} 

и я хочу, чтобы добавить анимацию, как это

[UIView animateWithDuration:0.1 
           delay:0.1 
          options:UIViewAnimationOptionTransitionCrossDissolve 
         animations:^{ 
          //yourAnimation 
         } completion:^(BOOL finished){ 
          NSLog(@"Animation is finished"); 
         }]; 

и вот мой

CGSize prev =CGSizeMake(286 , 223); 
    CGSize next =CGSizeMake(314.6 , 245.3); 

как зовут я использовать CGsize и анимации в - (Недействительными) didUpdateFocusInContext эту функцию

ответ

0

просто сделать что-то вроде этого:

if ([context.previousFocusedView isKindOfClass:[MyCell class]]) { 
    MyCell *cell = (MyCell*)context.previousFocusedView; 
    // do whatever you need with cell 
} 
Смежные вопросы