I am using the following to centre my panels (I have lots of them):
B4X:
Sub PositionThePanels
For Each v As View In Page1.RootPanel
If v Is Panel Then
Dim PanelTag As String
PanelTag = v.Tag
If PanelTag.StartsWith("Lesson") Then
v.Left = (Page1.RootPanel.Width - v.Width) / 2
v.Top = (Page1.RootPanel.Height - v.Height) / 2
End If
End If
Next
End Sub
The code does centre the panels...however, once the Sub has finished executing, the panels move back to the position they are in the designer.
I sometimes use outside the resize but use a value within the resize event. Is it ok ?
What i mean is for example under resize i use:
widthreal = 100%x
heightreal=100%y