-1

I write a tvOS app and I want to force a TouchableHighlight to be focused when the user tap on a specific on a specific button like 'up', 'down'... on the remote

Thanking you in advance

Julien Kode
  • 5,010
  • 21
  • 36
  • Same as https://stackoverflow.com/questions/43862802/react-native-tvos-how-to-force-a-button-to-be-focused/44700590#44700590 – Julien Kode Jun 28 '17 at 11:19

2 Answers2

1

Yes it is possible, with tvOS and react native if you want to force a TouchableHighlight component to be focus

set hasTVPreferredFocus to true

For example:

<TouchableHighlight
    hasTVPreferredFocus={true}
    onPress={() => {}}
>
    <Text>Hello</Text>
</TouchableHighlight>

You can see

Julien Kode
  • 5,010
  • 21
  • 36
0

The AppleTV remote doesn't have up/down/left/right buttons. It has a touch surface instead plus 3 dedicated buttons: Home, Menu, Play/Pause.

If you only have a single button, it will be in focus when the page is displayed and the user only needs to tap to activate.

AndrewCSP
  • 53
  • 6
  • Thanks for your answer :) it is possible to force the focus on an element ? if I have multiple button –  Apr 29 '17 at 10:40