iOS Question BCTextEngine replaces CsBuilder?

IdasI4A

Active Member
Licensed User
I use CsBuilder to add bold text to a CustomListView.
I create csBuilder and add it with CustomListView1.AddTextItem(Cs,Key), automatically each Item is adjusted to its height.
How can I do this with BCTextEngine?
B4X:
    Dim cs As CSBuilder
    
    cs.Initialize
    #if b4i
    cs.Append("Campo1: ").Font(Font.DEFAULT_BOLD).Append(Valores(1)).Pop.Append(CRLF).Append("Campo2: ").Font(Font.DEFAULT_BOLD).Append(Valores(2)).PopAll
    #else if b4a
    cs.Append("Campo1: ").Bold.Append(Valores(1)).Pop.Append(CRLF).Append("Campo2: ").Bold.Append(Valores(2)).PopAll
    #End If
    CustomListView1.AddTextItem(cs,1) ' add an item with two lines
    
    
    cs.Initialize
    #if b4i
    cs.Append("Otro1: ").Font(Font.DEFAULT_BOLD).Append(Valores(1)).Pop.Append(CRLF) _
        .Append("Otro2: ").Font(Font.DEFAULT_BOLD).Append(Valores(2)).Pop.Append(CRLF) _
        .Append("Otro3: ").Font(Font.DEFAULT_BOLD).Append(Valores(3)).Pop.Append(CRLF) _
        .Append("Otro4: ").Font(Font.DEFAULT_BOLD).Append(Valores(4)).Pop.Append(CRLF)     
    #Else If b4a
    cs.Append("Otro1: ").Bold.Append(Valores(1)).Pop.Append(CRLF) _
        .Append("Otro2: ").Bold.Append(Valores(2)).Pop.Append(CRLF) _
        .Append("Otro3: ").Bold.Append(Valores(3)).Pop.Append(CRLF) _
        .Append("Otro4: ").Bold.Append(Valores(4)).Pop.Append(CRLF)     
    #End If
    CustomListView1.AddTextItem(cs,2) ' add an item with four lines
Ejemplo.png
 

Erel

Administrator
Staff member
Licensed User
Top