Android Question Change Font and Text Size of B4XListTemplate Items

Mahares

Expert
Licensed User
Longtime User
I want to change the font and text size of the items in a B4XListTemplate. I tried all the 'options.' members below, but none works.
B4X:
Private Dialog As B4XDialog
Private options As B4XListTemplate
Dialog.Initialize (Activity)
        Dialog.TitleBarColor=xui.Color_Red
        options.Initialize
        options.CustomListView1.GetPanel(0).GetView(0).Font =xui.CreateDefaultFont(26)  'no good
        options.CustomListView1.GetPanel(0).Font =xui.CreateDefaultFont(26)'no good
        options.CustomListView1.GetBase.GetView(0).Font = xui.CreateDefaultFont(26)  'no good
        options.mBase.GetView(0).TextSize=26   'no good
        options.mBase.GetView(0).GetView(0).font=xui.CreateDefaultFont(26)    'no good
I keep guessing with so many members and hierarchical layers available, hoping one works.
Thank you.
 

KZero

Active Member
Licensed User
Longtime User
i don't think clv support changing font for text items but you can use csBuilder to change the font

B4X:
    Dim cs As CSBuilder
    
    options.Options = Array(cs.Initialize.Color(Colors.Red).Typeface(Typeface.MONOSPACE).Append("cat").PopAll, "Dog", "Fish", "Crocodile")
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Which property? It works here.
Here is the error in B4A: 'unknown member: font. I use XUI Views lib 2.23. options is a B4XListTemplate
B4X:
options.Options = Array("Soccer", "Swimming")
        options.CustomListView1.DesignerLabel.Font =xui.CreateDefaultFont(26)  'unknown member: font
 
Upvote 0
Top