I have been using B4A since 2012 but still struggle with multiple screen sizes. Have watched the tutorial twenty times.
Attached is a simple project. See Trigger_Page1 layout. It works if I set TOP and LEFT as anchors. If I set both HORIZONTAL and VERTICAL anchors, then the button does not show on the screen. Device is Samsung Galaxy S7.
It works with horizontal and vertical anchors if Trigger_Page1 is loaded in Activity_Create. Does not work if I call a sub. AppCompat stuff is in the Project because I use it in the App I am trying to make work.
Private Sub PageTest
'' This DOES NOT Work if Horizontal and Vertical Anchors Set
Page1.Initialize("Page1")
' Page1.LoadLayout("Trigger_Page1")
Activity.AddView(Page1,0,0,100%x,100%y)
Page1.LoadLayout("Trigger_Page1")
End Sub
If you migrate to B4XPages, you will see that it becomes intuitive and makes a lot more sense. But if you are adding a panel programmatically, you always have to initialize it, then add it to the root or activity, then load the layout onto it in that sequence.