Do you have a project example?
Just create your initial activity/view with a master panel that will load layouts.
I like to create my own navigation system that works with B4J/B4A/B4i all. Here's how I do it:
1. Define what you want each page to have: (Could just be a list of panels, but all of my pages have titles as well.)
Type navigationPage (viewTitle As String, viewPanel As Panel)
2. Add your page definition to your global variables.
3. Make your Add/Back/Clear methods:
public Sub addPage1(navPage As navigationPage)
If(navPages.IsInitialized = False) Then
navPages.Initialize
End If
navPages.Add(navPage) 'Add navpage to page list
contentView.AddView(navPage.viewPanel, 0,0,contentView.Width, contentView.height) 'add this to the top of our master panel
End Sub
public Sub backPage1()
If(navPages.IsInitialized And navPages.Size > 1) Then
Dim iNavPage As navigationPage = navPages.Get(navPages.Size - 1) 'get the topmost panel
iNavPage.viewPanel.RemoveView() 'remove the view from contentPanel
navPages.RemoveAt(navPages.Size - 1) 'remove the navPage from our list
End If
End Sub
public Sub clearPages1()
If(navPages.IsInitialized) Then
navPages.Clear() 'clear page list
End If
contentView.RemoveAllViews() 'clear all views inside of master panel
End Sub
Add A Page:
public Sub testAdd()
Dim navNewsPage As navigationPage
Dim p As Panel
p.Initialize("")
p.SetLayout(0, 0, contentView.Width, contentView.height)
p.LoadLayout("newssubscriptiontabcard")
navNewsPage.viewPanel = p
navNewsPage.viewTitle = "News Feed"
addPage1(navNewsPage, 0)
End Sub
Again, this is just how I do it. This is the only view I load to the activity. The rest of my views are loaded and STACKED on top of each other in the main content panel.
I make my own titleBar and NavBar so that I can copy/paste directly from iOS. You could make the entire main view a single panel, and load each of your pages. You will need to have a back button to delete the top-most view.
Heres my designer script for the contentView: (You could just use anchors)
contentView.Left = 0
contentView.Top = titlePanel.Bottom
contentView.Height = navigationPanel.Top - titlePanel.Bottom
contentView.Width = 100%x