B4J Question [B4X][XUI] xCustomlistview

jayel

Active Member
Licensed User
Longtime User
hello,

The xui defaultfont won't change the fontsize, the defaultfontbold does change the font...
No error !

B4X:
Sub CreateListItem(datum As String, title As String, body As String, Width As Int, Height As Int) As Pane
    Dim p As Pane
    p.Initialize("")
    p.SetSize(Width,Height)
    p.LoadLayout("notificationlistitem")
    Dim xlblTitle As B4XView = lblTitle
    xlblTitle.Font = xui.CreateDefaultBoldFont(14) '<---- OK
    xlblTitle.Text = title
    Dim xlblBody As B4XView = lblBody
    xlblBody.Font = xui.CreateDefaultFont(12) '<----- NOT OK
    xlblBody.Text = body
    Return p
End Sub
 

jayel

Active Member
Licensed User
Longtime User
See attachment

And when I change in the layout file it doesn't work also.
 

Attachments

  • xcustomlistviewtest.zip
    8.4 KB · Views: 240
Upvote 0

RWK

Member
Licensed User
Longtime User
Hmmm... Here it will

B4X:
Sub CreateListItem(datum As String, title As String, body As String, Width As Int, Height As Int) As Pane
    Dim p As Pane
    p.Initialize("")
    p.SetSize(Width,Height)
    p.LoadLayout("notificationlistitem")
    Dim xlblTitle As B4XView = lblTitle
    xlblTitle.Font = xui.CreateDefaultBoldFont(20)
    xlblTitle.Text = title
    Dim xlblBody As B4XView = lblBody
    xlblBody.Font = xui.CreateDefaultFont(xFont)
    xFont = xFont + 8
    xlblBody.Text = body
    Return p
End Sub

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…