Hi
Based on what we have learned in lesson 1 and 2, here we will explorer another layout element, the accordion.
The accordion we can create comes in two flavours, one vertical and one horizontal as expected.
The code module that we need to call for this tut is pgLayouts1.Init on BANano_Ready ONLY.
For this we have created a WixAccordion element with some few properties and a method to add some elements to it. Let's look at the code..
We have created a 'pg' WixPage element. After initializing it we create an accordion called acc.
We want to ensure that this displays in a vertical manner so we need to turn off the default setting by executing .SetHorizontal(False)
We then start adding items to it, this takes the header, the body, the width of each and whether its collapsed or not.
After adding the items we assign the accordion object to the page using
The Page object of WixPage and the Accordion object are both defined from WixElement.
We then render the UI with pg.UI.
The accordion in essence takes the whole page here.
Based on what we have learned in lesson 1 and 2, here we will explorer another layout element, the accordion.
The accordion we can create comes in two flavours, one vertical and one horizontal as expected.
The code module that we need to call for this tut is pgLayouts1.Init on BANano_Ready ONLY.
For this we have created a WixAccordion element with some few properties and a method to add some elements to it. Let's look at the code..
B4X:
'Static code module
Sub Process_Globals
Private pg As WixPage
End Sub
Sub Init()
pg.Initialize("")
Dim acc As WixAccordion
acc.Initialize("")
acc.SetHorizontal(False)
acc.AddItem("","Column 1","Hellow from column 1",200,False)
acc.AddItem("","Column 2","Hellow from column 2",300,True)
acc.AddItem("","Column 3","Hellow from column 3",0,True)
'assign accordion to the page
pg.Page = acc.Accordion
'
pg.ui
End Sub
We have created a 'pg' WixPage element. After initializing it we create an accordion called acc.
We want to ensure that this displays in a vertical manner so we need to turn off the default setting by executing .SetHorizontal(False)
We then start adding items to it, this takes the header, the body, the width of each and whether its collapsed or not.
After adding the items we assign the accordion object to the page using
B4X:
pg.Page = acc.Accordion
The Page object of WixPage and the Accordion object are both defined from WixElement.
We then render the UI with pg.UI.
The accordion in essence takes the whole page here.