When adding a TwoLine item to a ListView, is there a way to have the top line left justified and the second line right-justified?
I want to have text on the first line and a number on the second line and it would look better that way.
TIA
Below is the code using XCustomListView which is recommended
B4X:
Dim csb As CSBuilder
csb.Initialize.Alignment("ALIGN_NORMAL").Append("First line").Append(CRLF).Pop
csb.Alignment("ALIGN_OPPOSITE").Append("123").PopAll
clv1.AddTextItem(csb, csb)
Dim csb1, csb2 As CSBuilder
csb1.Initialize.Alignment("ALIGN_NORMAL").Append("First line").PopAll
csb2.initialize.Alignment("ALIGN_OPPOSITE").Append("123").PopAll
lv.AddTwoLines(csb1, csb2)
Not really.
This is not to entice you to use xClv, because everyone has their own reason for using what they want to use, but you can see that the syntax can be simpler for xClv than Listview
B4X:
lbl1.Text=$"Didier9 ${x} From Florida, America"$ 'The 2 labels: lbl1, lb2 are declared as B4Xviews
lbl2.SetTextAlignment("CENTER", "RIGHT")
lbl2.Text=$"${Power(x,3)}"$
Not really.
This is not to entice you to use xClv, because everyone has their own reason for using what they want to use, but you can see that the syntax can be simpler for xClv than Listview
B4X:
lbl1.Text=$"Didier9 ${x} From Florida, America"$ 'The 2 labels: lbl1, lb2 are declared as B4Xviews
lbl2.SetTextAlignment("CENTER", "RIGHT")
lbl2.Text=$"${Power(x,3)}"$
Thank you, yes this particular operation is simpler, but I am not familiar with the xClv and my app at the moment uses the regular ListView so I would have to do more research how to use it and possibly more changes to the existing code, which would certainly be a worthwhile endeavor for the long term but it's getting in the way of what I am trying to do right now
The app I am working on is 4-5 years old and I use it every day (expense tracker), I am just trying to add a bit of functionality.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.