I am new to tvOS app. I have created a custom button in UICollectionViewCell
within UICollectionView
. When I load my view controller, I am getting focus to the first cell of the UICollectionView, but by pressing the next key on my keyboard, focus isn't moving to next cell.
I have six cells in my UICollectionView which doesn't require scrolling, this means the cells are fitting properly within the width of UICollectionView. With six cells, I can not move the focus to the next cell. But if I add one more cell to UICollectionView, focus is moving to the next cell properly. I am not sure what's going on. Can anyone please help me out in this?
Thanks
I had this as well with nested collection views. For me, the problem was that the inner collection view did not override
-(BOOL)canBecomeFocus
and returnNO
.What helped me debugging this issue is to open the view hierarchy, grab the address of the view (by right-clicking on print description of view) that does not get focused and call
po [<view address> _whyIsThisViewNotFocusable]
, this will most likely tell you the problem. In my case it read: