Hello guys,
I read this topic and was trying to implement some text enhancements to my app. It happens that the CS elements seems to work directly on the view and, in my case, I work literals and fields in string literals and, at the end, combine these string literals on the final label.text view object. Then I noticed that this approach (use of intermediate literals) produce no effect on the result, resulting no formatting at all at the end, as can be seen in the attached image,
It worked, however, when I prepare the CS string and send it right to the label.text view.
Is there other way to apply formatting to my resulting text? HTML tags <B> </B> <I> </I> would be enough.
Regards,
Fernando
I read this topic and was trying to implement some text enhancements to my app. It happens that the CS elements seems to work directly on the view and, in my case, I work literals and fields in string literals and, at the end, combine these string literals on the final label.text view object. Then I noticed that this approach (use of intermediate literals) produce no effect on the result, resulting no formatting at all at the end, as can be seen in the attached image,
It worked, however, when I prepare the CS string and send it right to the label.text view.
Is there other way to apply formatting to my resulting text? HTML tags <B> </B> <I> </I> would be enough.
Regards,
Fernando
B4X:
Select wCodEvento
Case 1 ' *** USING CS ON THE 1ST CASE JUST FOR TEST ***
cs.Initialize.Append(IIF(wRegistro(7) = Null, "Nascid" & wSufixo, "Nascid" & wSufixo & " em " & wRegistro(7)) & " no dia ")
cs.Bold.Color(Colors.Green).Append(wDataEvento).Pop.Pop 'two pops: the first removes the green color and the second removes the bold style
cs.Append(". ").PopAll
wTxtNascimento = cs
' lblDetalhePessoa.text = cs
' Return
Case 2 '
wTxtCasamento = wTxtCasamento & "Casad" & wSufixo & " no dia " & wDataEvento & " com " & wRegistro(8) & IIF(wRegistro(7) = Null, "", ", em " & wRegistro(7)) & ". "
Case 3 '
wTxtBatizado = "Batizad" & wSufixo & " no dia " & wDataEvento & IIF(wRegistro(7) = Null, "", ", em " & wRegistro(7)) & ". "
End Select
Next
' *** CS text (wTxtNascimento) prepared above does nothing when combined as below
lblDetalhePessoa.text = wTxtApelido & wTxtIdade & wTxtNascimento & wTxtPaiMae & wTxtCasamento & wTxtFalecimento & wTxtCrismado & wTxt1Comunhao & wTxtFormado & wTxtDivorcio & wTxtEmancipado