Hi, in b4a I typically move views around (to center them, etc.) programatically however the way I think it should work in B4I isn't working:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private Button1 As Button
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
Page1.RootPanel.LoadLayout("test")
Button1.Left = GetDeviceLayoutValues.Width/2-Button1.Width/2
Button1.top = GetDeviceLayoutValues.Height/2-Button1.Height/2
NavControl.ShowPage(Page1)
End Sub
the test layout contains a single button, button1. When I run it on the iphone the button does not move. What am I missing? And thanks!
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private Button1 As Button
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
Page1.RootPanel.LoadLayout("test")
Button1.Left = GetDeviceLayoutValues.Width/2-Button1.Width/2
Button1.top = GetDeviceLayoutValues.Height/2-Button1.Height/2
NavControl.ShowPage(Page1)
End Sub
the test layout contains a single button, button1. When I run it on the iphone the button does not move. What am I missing? And thanks!