Joey249 Member Aug 11, 2023 #1 So i've configured my app already and then later on decided I wanted to use TabStripViewPager, The issue i'm having is i've all my code on separate pages for separate layouts, and i'm not quite sure how to load in that code/module with each TabStrip layout. For example, with the TabStrip it loads in like this B4X: Private TabStrip1 As TabStrip TabStrip1.LoadLayout("LAYOUTNAME", "Title for layout") while on other pages I have previously loaded it in like B4X: Dim Page1 As Page1MODULECODE Page1.Initialize B4XPages.AddPage("LAYOUTNAME", Page1) B4XPages.ShowPage("LAYOUTNAME") where "LAYOUTNAME" would be connected to the code on "Page1 "/ "Page1MODULECODE", is there any way to link in the code like this with the TabStrip as it would be a bit messy having all the code from all TabStrip layouts in one page, any help would be greatly appreciated!
So i've configured my app already and then later on decided I wanted to use TabStripViewPager, The issue i'm having is i've all my code on separate pages for separate layouts, and i'm not quite sure how to load in that code/module with each TabStrip layout. For example, with the TabStrip it loads in like this B4X: Private TabStrip1 As TabStrip TabStrip1.LoadLayout("LAYOUTNAME", "Title for layout") while on other pages I have previously loaded it in like B4X: Dim Page1 As Page1MODULECODE Page1.Initialize B4XPages.AddPage("LAYOUTNAME", Page1) B4XPages.ShowPage("LAYOUTNAME") where "LAYOUTNAME" would be connected to the code on "Page1 "/ "Page1MODULECODE", is there any way to link in the code like this with the TabStrip as it would be a bit messy having all the code from all TabStrip layouts in one page, any help would be greatly appreciated!
Solution Erel Aug 13, 2023 Create a class for each tab page. It will NOT be a B4XPage class. Create a layout with a single panel that is anchored to all sides. Use it for each tab page: Code: TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 1") Dim tab1 As Tab1Class tab1.Initialize(PanelFromLayout) TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 2") Dim tab2 As Tab2Class tab2.Initialize(PanelFromLayout)
Create a class for each tab page. It will NOT be a B4XPage class. Create a layout with a single panel that is anchored to all sides. Use it for each tab page: Code: TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 1") Dim tab1 As Tab1Class tab1.Initialize(PanelFromLayout) TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 2") Dim tab2 As Tab2Class tab2.Initialize(PanelFromLayout)
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2023 #2 Create a class for each tab page. It will NOT be a B4XPage class. Create a layout with a single panel that is anchored to all sides. Use it for each tab page: Code: TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 1") Dim tab1 As Tab1Class tab1.Initialize(PanelFromLayout) TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 2") Dim tab2 As Tab2Class tab2.Initialize(PanelFromLayout) Upvote 1 Solution
Create a class for each tab page. It will NOT be a B4XPage class. Create a layout with a single panel that is anchored to all sides. Use it for each tab page: Code: TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 1") Dim tab1 As Tab1Class tab1.Initialize(PanelFromLayout) TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 2") Dim tab2 As Tab2Class tab2.Initialize(PanelFromLayout)
Joey249 Member Aug 14, 2023 #3 Erel said: Create a class for each tab page. It will NOT be a B4XPage class. Create a layout with a single panel that is anchored to all sides. Use it for each tab page: Code: TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 1") Dim tab1 As Tab1Class tab1.Initialize(PanelFromLayout) TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 2") Dim tab2 As Tab2Class tab2.Initialize(PanelFromLayout) Click to expand... Worked perfectly, thank you Erel! Upvote 0
Erel said: Create a class for each tab page. It will NOT be a B4XPage class. Create a layout with a single panel that is anchored to all sides. Use it for each tab page: Code: TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 1") Dim tab1 As Tab1Class tab1.Initialize(PanelFromLayout) TabStrip1.LoadLayout("LAYOUT_WITH_PANEL", "Title for layout 2") Dim tab2 As Tab2Class tab2.Initialize(PanelFromLayout) Click to expand... Worked perfectly, thank you Erel!