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
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
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
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.