Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButton on different Y level can't be focused on tvOS

I started developing apps for Apple TV and I have this problem whit buttons. I have a screen where are several buttons on bottom of the screen and then there is one, which is in the middle (see screenshot to understand). The problem is that I can't get focused the middle button. Focus is only on bottom three buttons. The problem is obviously caused by the Y position, when I move the button on bottom of the screen, it gets focused.

Buttons are created in storyboard, there is no code in ViewController. Settings in storyboard for the middle button are equal with settings for bottom buttons. Do I have to handle this manually in code? Or is it even possible to get focus movement like this? I would appreciate any information, thanks.

1]

I'm still developing in simulator.

like image 243
Fiser33 Avatar asked Sep 24 '15 11:09

Fiser33


1 Answers

So I was guided by apple to the solution. It requires a little coding using UIFocusGuide. Apple has a sample code for this.

like image 138
Fiser33 Avatar answered Oct 09 '22 22:10

Fiser33