B4J Tutorial [BANanoWebix] Lesson 25 Template

Mashiane

Expert
Licensed User
Ola

The template is just also like the scrollview, enabling one to create elements..

Lesson25_Template.png


In this image we depict how we have created a container and then added templates on the row. One might use this for displaying data or emphasing something etc.

B4X:
Sub Init(pgContainer As String)
    pg.Initialize("", pgContainer).SetHeader("Lesson 25: Template")
    '
    Dim we As WixElement
    we.Initialize("we").SetPadding(40)
    '
    Dim t1 As WixTemplate
    t1.Initialize("t1").SetType("section").SetTemplate("Snarky Greeting")
    '
    Dim t2 As WixTemplate
    t2.Initialize("t2").SetTypeClean("").SetTemplate("Hello there, ugly bag of mostly water!")
    '
    we.AddRowItems(Array(t1.Item, t2.Item))
    '
    Dim pr1 As WixRow
    pr1.Initialize("pr1").SetAutoWidth(True).AddRows(we.Item)
    pr1.AddRows(CreateMap())
    '
    pg.AddRow(pr1)
    '
    pg.ui
End Sub
 
Top