Muliple screens and ScrollView

mrossen

Active Member
Licensed User
Longtime User
Hi There,

I am a bit confused.
I have tried to make 3 different screen layouts with ScrollView and Panel.
I Can shift between the screen but it seems like the screen is locked or with no focus.

B4X:
Sub Activity_Create(FirstTime As Boolean)
    ScrollViewMain.Initialize(0)
   ScrollViewInfo.Initialize(0)
   ScrollViewSettings.Initialize(0)
   WebviewGoogle.Initialize("")
 
   PanelMain = ScrollViewMain.Panel : PanelMain.Visible = False
   PanelInfo = ScrollViewInfo.Panel : PanelInfo.Visible = False
   PanelSettings = ScrollViewSettings.Panel : PanelSettings.Visible = False
   
   Activity.AddView(ScrollViewMain, 0, 0, 100%x, 100%y)
   Activity.AddView(ScrollViewInfo, 0, 0, 100%x, 100%y)
   Activity.AddView(ScrollViewSettings, 0, 0, 100%x, 100%y)
   
   LoadMainLayout
   LoadInfoLayout   
   
   Activity.AddMenuItem("Start", "mnuMain")
   Activity.AddMenuItem("Info", "mnuInfo")
   Activity.AddMenuItem("Indstillinger", "mnuSettings")
   Activity.AddMenuItem("Om", "mnuAbout")


End Sub

Sub LoadMainLayout

     ButtonGetData.Initialize("ButtonGetData")
   ButtonGetData.Text = "Hent Data"

      ButtonGetPos.Initialize("ButtonGetPos")
   ButtonGetPos.Text = "Hent Position"
   
   
   Dim LabelLat As Label
     LabelLat.Initialize("")
   LabelLat.Text = "Længdegrad.:"
   LabelLat.Textsize= 16
   
   
      LabelLatData.Initialize("")
   LabelLatData.Text = "?????N"
   LabelLatData.Textsize= 16
   
   Dim LabelLon As Label
      LabelLon.Initialize("")
   LabelLon.Text = "Breddegrad.:"
   LabelLon.Textsize= 16
   
     LabelLonData.Initialize("")
   LabelLonData.Text = "?????E"
   LabelLonData.Textsize= 16
   
   Dim LabelSpeed As Label
      LabelSpeed.Initialize("")
   LabelSpeed.Text = "Hastighed.:"
   LabelSpeed.Textsize= 16
   'LabelSpeed.Typeface = Bold
   
     LabelSpeedData.Initialize("")
   LabelSpeedData.Text = "0 Km/t"
   LabelSpeedData.Textsize= 16
   
   Dim LabelIgn As Label
      LabelIgn.Initialize("")
   LabelIgn.Text = "Tænding.:"
   LabelIgn.Textsize= 16
   
      LabelIgnDAta.Initialize("")
   LabelIgnData.Text = "???"
   LabelIgnData.Textsize= 16
   
   Dim LabelDir As Label
      LabelDir.Initialize("")
   LabelDir.Text = "Retning.:"
   LabelDir.Textsize= 16
   
      LabelDirDAta.Initialize("")
   LabelDirData.Text = "???"
   LabelDirData.Textsize= 16
   
   PanelMain.AddView(ButtonGetData, 10, 15, 140dip, 40dip)
   PanelMain.AddView(ButtonGetPos, 260, 15, 140dip, 40dip)
   PanelMain.AddView(WebViewGoogle, 15, 90, 300dip, 300dip)
   PanelMain.AddView(LabelLat, 15, 560, 100dip, 40dip)
   PanelMain.AddView(LabelLatData, 200, 560, 100dip, 40dip)
   PanelMain.AddView(LabelLon, 15, 605, 100dip, 40dip)
   PanelMain.AddView(LabelLonData, 200, 605, 100dip, 40dip)
   PanelMain.AddView(LabelSpeed, 15, 650, 100dip, 40dip)
   PanelMain.AddView(LabelSpeedData, 200, 650, 100dip, 40dip)
   PanelMain.AddView(LabelIgn, 15, 695, 100dip, 40dip)
   PanelMain.AddView(LabelIgnData, 200, 695, 100dip, 40dip)
   PanelMain.AddView(LabelDir, 15, 740, 100dip, 40dip)
   PanelMain.AddView(LabelDirData, 200, 740, 100dip, 40dip)
   
   PanelMain.Height = 540dip
   
   PanelMain.Visible = True


       
End Sub
Sub LoadInfoLayout

     ButtonGetInfoData.Initialize("ButtonGetInfoData")
   ButtonGetInfoData.Text = "Hent Info Data"
   
   PanelInfo.AddView(ButtonGetInfoData, 10, 15, 140dip, 40dip)
   
   PanelInfo.Height = 540dip
   
End Sub
Sub mnuMain_Click

   PanelMain.Visible = True
   PanelInfo.Visible = False
   PanelSettings.Visible = False
   
End Sub
Sub mnuInfo_Click

   PanelMain.Visible = False
   PanelInfo.Visible = True
   PanelSettings.Visible = False
   
End Sub
Sub mnuSettings_Click

   PanelMain.Visible = False
   PanelInfo.Visible = False
   PanelSettings.Visible = True
   
End Sub
Sub mnuAbout_Click

   Msgbox("x", "x")
   
End Sub
 

klaus

Expert
Licensed User
Longtime User
It would be easier to help you if you post your project as a zip file.
In the IDE File/Export As Zip menu. So we could dirctly test it.
After a first look you should set the ScrollView visible parameter to False and True and not their internal Panels.

Best regards.
 
Upvote 0
Top