Mar 19, 2017 Replies: 4 The Accordion container (added in B4J v5.0) is a container similar to TabPane. It holds TitledPanes. These are panes with titles. Using the accordion is quite simple. Add the Accordion node with the designer and create a layout file for each of the TitledPanes. Code: Copy Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("Main") Accordion1.LoadLayout("Pane1", "Pane 1") Accordion1.LoadLayout("Pane2", "Pane 2") Accordion1.LoadLayout("Pane3", "Pane 3") MainForm.Show End Sub It is recommended to use anchors in the layouts so the layout will be resized automatically based on the available size. Attachments AccordionExample.zip AccordionExample.zip 5.1 KB · Views: 1,877 Click to expand...
The Accordion container (added in B4J v5.0) is a container similar to TabPane. It holds TitledPanes. These are panes with titles. Using the accordion is quite simple. Add the Accordion node with the designer and create a layout file for each of the TitledPanes. Code: Copy Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("Main") Accordion1.LoadLayout("Pane1", "Pane 1") Accordion1.LoadLayout("Pane2", "Pane 2") Accordion1.LoadLayout("Pane3", "Pane 3") MainForm.Show End Sub It is recommended to use anchors in the layouts so the layout will be resized automatically based on the available size.
warwound Expert Licensed User Longtime User May 15, 2017 #2 Has the documentation for Accordion been omitted from the online pages at: https://www.b4x.com/b4j/documentation.html?
Has the documentation for Accordion been omitted from the online pages at: https://www.b4x.com/b4j/documentation.html?
Cableguy Expert Licensed User Longtime User Nov 8, 2017 #4 Can the TitledPanes Titles be set using other methods than the LoadLayout? I would like to preate the TitledPanes in code, and add view to the panes in code.
Can the TitledPanes Titles be set using other methods than the LoadLayout? I would like to preate the TitledPanes in code, and add view to the panes in code.
Erel B4X founder Staff member Licensed User Longtime User Nov 9, 2017 #5 Cableguy said: I would like to preate the TitledPanes in code, and add view to the panes in code. Click to expand... This is a mistake in most cases. You can create an empty layout and load it whenever you need. You can also create a layout file with some of the views, load it and add the "dynamic" views programmatically.
Cableguy said: I would like to preate the TitledPanes in code, and add view to the panes in code. Click to expand... This is a mistake in most cases. You can create an empty layout and load it whenever you need. You can also create a layout file with some of the views, load it and add the "dynamic" views programmatically.