Skip to content Skip to sidebar Skip to footer

React-native: Tvos How To Force A Button To Be Focused?

It is possible to force a button to be focused ? I know the user can focused an element but I want to make it programmatically

Solution 1:

Yes it is possible, with tvOS and react native if you want to force a focusable component to be focus you just need to set hasTVPreferredFocus to true

For example:

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

Post a Comment for "React-native: Tvos How To Force A Button To Be Focused?"