so this is my scenario: I have a main layout which has a scrollview. i call other panels from different layouts.
the problem is occurs when i press the back softkey to go to the main layout. the previous panel is still visible and when i scroll up, my main panel scrolls too making the previous panel still visible.
here's my back code:
the problem is occurs when i press the back softkey to go to the main layout. the previous panel is still visible and when i scroll up, my main panel scrolls too making the previous panel still visible.
here's my back code:
B4X:
Sub Activity_KeyPress (key As Int) As Boolean
If key=KeyCodes.KEYCODE_BACK Then
Try
If Panelbscs1.Visible=True Then
Panelbscs1.Visible=False
End If
If Panelbscs2.Visible=True Then
Panelbscs2.Visible=False
End If
If Panelbscs3.Visible=True Then
Panelbscs3.Visible=False
End If
If Panelbscs6.Visible=True Then
Panelbscs6.Visible=False
End If
If Panelbscs8.Visible=True Then
Panelbscs8.Visible=False
End If
If Panelcontent.Visible=True Then
Panelcontent.Visible=False
End If
Activity.Title="Timetable"
ScrollView1.Panel.Width=600dip
ScrollView1.Panel.Height=2300dip
Catch
ToastMessageShow("Reloading",False)
Activity_Create(True)
End Try
'Panelcontent.Visible=True
'Activity.RerunDesignerScript("MainWindow",600dip ,1200dip)
'Activity_Create(True)
'hidepanels
'ScrollView1.Panel.RemoveView
'Activity_Create(True)
'Activity.LoadLayout("MainWindow")
'ScrollView1.Panel.LoadLayout("Content")
'If Panelbscs4.Visible=True Then
'Panelbscs4.Visible=False
'End If
'Activity.RerunDesignerScript("Content",600dip ,1300dip)
Activity.Title="Timetable"
ScrollView1.Panel.Width=600dip
ScrollView1.Panel.Height=2300dip
Return True
End If
End Sub