Hi All
I am trying to add a Landscape variant to an existing App. The user chooses Portrait or Landscape as a setting, the default is portrait.
Been through the pain of creating the variant and now failing to get it to work.
The App starts in Portrait and all is good, click on the button to toggle to landscape it sort of works. [I need to do more work on the layout]
This Is The Question.
Click on the toggle button to go back to Portrait which it does but the layout is scrambled. What Happened?
Below is the essence of the code.
It looks straight forward but something is missing.
Regards Roger
I am trying to add a Landscape variant to an existing App. The user chooses Portrait or Landscape as a setting, the default is portrait.
Been through the pain of creating the variant and now failing to get it to work.
The App starts in Portrait and all is good, click on the button to toggle to landscape it sort of works. [I need to do more work on the layout]
This Is The Question.
Click on the toggle button to go back to Portrait which it does but the layout is scrambled. What Happened?
Below is the essence of the code.
Toggle Portrait and Landscape:
Sub Process_Globals
Private Phone1 As Phone
Private ScrnOrientVal As Int '1 = Portrait, 0 = Landscape
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
ScrnOrientVal = StateManager.GetSetting2("ScrnOrientVal", 1)
Phone1.SetScreenOrientation(ScrnOrientVal)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
StateManager.SetSetting ("ScrnOrientVal",ScrnOrientVal)
StateManager.SaveSettings 'Saves the settings above
End Sub
Sub PortLand_Click
ScrnOrientVal = 1 - ScrnOrientVal 'Toggles ScrnOrientVal between 1 and 0
Phone1.SetScreenOrientation(ScrnOrientVal) '1 = Portrait, 0 = Landscape
End Sub
It looks straight forward but something is missing.
Regards Roger