That is incorrect. It has nothing to do with zOrder. The way the OS handles tab order between views is activity relative position top to bottom and left to right, diagonally.
That is incorrect.
I did not say that this was the OS behavior.
The way the OS handles tab order between views is actually done in the XML where the views are defined. ITS NOT allways top to bottom and left to right, diagonally. So, if you made your app in java an create the layoust in a text editor, you can have complete conntrol about the "tab order"
(nextFocusDown, nextFocusLeft, nextFocusRight, nextFocusUp)
BUT in B4A you have not this control, so the better practice is to make your layouts in the bstract designer, with the correct zOrdering to let the compiler create the XML with the tab order you expected.
ANY 'visible' view can accept focus... not just the ones you can see.
Shure, this is really clear for newcomers. Any view in the activity which
visible property is set to TRUE, can receive focus, no matter if its on screen or not.
If you are using panels to contain full-screen interfaces make sure to set any other panel behind it as hidden to avoid this issue.
There is not a
hidden property. (Again, not clear for newcomers)
The correct tip is Set the
visible property to
TRUE, of all the panels you want to exclude from gaining focus (all the chlid views will be excluded as well)
Example code
Sub ChangePage(Page As Int)
pnlPage1.Visible = False
pnlPage2.Visible = False
pnlPage3.Visible = False
pnlPage4.Visible = False
Select Case Page
Case 1
pnlPage1.Visible = True
Case 2
pnlPage2.Visible = True
Case 3
pnlPage3.Visible = True
Case 4
pnlPage4.Visible = True
End Select
End Sub