Replies: 1 comment
-
@Lxy-Mango maybe you have accidentally posted it in a wrong thread? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Show & Tell
Body
Overall idea:
The outer stack layout includes the TextInput component used to start the keyboard, and the Row layout loops out four Text components, which are overlaid on top of the TextInput component to display the input numbers.

Define two parameters, code is used to accept input text, someArray is used as the number of Text components to be displayed, and the numbers in it are compared with the length of the code to distinguish whether the input box is written with text.
Here we loop through someArray. When the Text component is not filled in, it displays a '-' and the Text component that is about to write a number is highlighted in orange. When all four input boxes have numbers, the last box is highlighted.
Difficulty: Event transparency is required. Set. hitTestBehavior (HitTestMode. Transparent) on the Row layout, so that both the self and child nodes respond to touch testing without blocking the touch testing of sibling nodes. It will not affect the touch testing of ancestral nodes.
Complete code:
Beta Was this translation helpful? Give feedback.
All reactions