natiny.view.set_focusable
natiny.view.set_focusable(view [, focusable])
Sets whether a press can give focus to a view. New views are focusable; a press on a non-focusable view instead selects its nearest focusable ancestor, or clears the focus when there is none.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
view |
number |
View handle | |
focusable |
boolean |
false |
Whether a press can give focus to view |
Example
-- Keep the backdrop pickable without letting it take the focus.
natiny.view.set_focusable(backdrop, false)
Notes
- Setting
falseclears the focus whenviewor one of its descendants is currently focused. - This setting does not disable picking, hover, presses, clicks, or hooks.