How can i place the Label inside CollectionView so that nearest Cell affects the "Y" position of the Label?

242 Views Asked by At

How can i place the Label inside CollectionView so that nearest cell also affects the "Y" position of the Label ? https://developer.apple.com/tvos/human-interface-guidelines/visual-design/images/visual-design-animation.mp4

So the idea is, when you have Cell in focus that is near your UILabel, your UILabel change its "Y" position by +/- 20 points for example. I know that i have callback didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator), but i cant get UILabel center.y to change if Cell that is near in focus.

I have nested Collections. Main CollectionView have vertical scrollDirection and Cells that holds inside another Collections with horizontal scrollDirection.

cell that need to bring label UP

Any help would be appreciated ) Thanx!

2

There are 2 best solutions below

1
On

You can use Section header for that purpose. or you can calculate cell spacing according to the label.

0
On

A behaviour that you described in this question is a standard behaviour for the TVML-item called shelf with a header label. I think that you need to use a hybrid application, you should replace your current page with a TVML page (it will looks more pretty than you planned to implement with the UICollectionView).