Multiple layout

gjoisa

Active Member
Licensed User
Longtime User
Hi all !
Is it possible to use multiple layouts in a single activity ? I tried to do so , but the previous layout will not be paused while loading a new layout . Like Activity.LoadLayOut function ,if there is Activity.RemoveLayout will be helpful .
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Something like:
B4X:
Sub Globals
    Dim Panel1, Panel2, Panel3 As Panel
End Sub 

Sub Activity_Create(FirstTime As Boolean)
    Panel1.Initialize("") : Panel1.Visible = False
    Panel2.Initialize("") : Panel2.Visible = False
    Panel3.Initialize("") : Panel3.Visible = False
    Panel1.LoadLayout("1") 'Regular layouts created with the designer
    Panel2.LoadLayout("2")
    Panel3.LoadLayout("3")
    Activity.AddView(Panel1, 0, 0, 100%x, 100%y)
    Activity.AddView(Panel2, 0, 0, 100%x, 100%y)
    Activity.AddView(Panel3, 0, 0, 100%x, 100%y)
    
    Panel1.Visible = True
    
    'later switch to second layout
    Panel1.Visible = False
    Panel2.Visible = True
End Sub
 
Upvote 0

drhamel

Member
Licensed User
Longtime User
I know this is an old post but I am having exactly the same question/problem concerning views. Are there any more examples of this? Especially ones that keep the parent correct. So I could just hit the back key to go from panel2 back to panel1?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…