Hi,
I'm using the xCustomlistview in B4A vers 9.5, actually i'm using the xCustomListView1.addtextItem(MyText,myValue)
I want to be able to define the horizontal alignment of each cell as i put it in the listview.
I find no place toe set the horizontal, vertical gravity for each cell as it is inserted in the list
Is there a simple way to tell the newly added textitem to center it's content or leave it as default (left align) wich i don't need to setup since it is always set to left.
I use the csBuilder and it works fine, but when i insert text that is bigger then the cell, the cell itself does not adjust it's size, only if i use the addTextItem with the .asview.width=-2 and asview.height=-2
But if i put the cs string, i loose the auto size adjust, so if i could use the addtextitem and center it's content on the new cell just created, that will be fine.
So anybody out there who knows how to set the horizontal alignment will be greatly appreciated
Here is a small sample of code
Any idea anyone
I'm using the xCustomlistview in B4A vers 9.5, actually i'm using the xCustomListView1.addtextItem(MyText,myValue)
I want to be able to define the horizontal alignment of each cell as i put it in the listview.
I find no place toe set the horizontal, vertical gravity for each cell as it is inserted in the list
Is there a simple way to tell the newly added textitem to center it's content or leave it as default (left align) wich i don't need to setup since it is always set to left.
I use the csBuilder and it works fine, but when i insert text that is bigger then the cell, the cell itself does not adjust it's size, only if i use the addTextItem with the .asview.width=-2 and asview.height=-2
But if i put the cs string, i loose the auto size adjust, so if i could use the addtextitem and center it's content on the new cell just created, that will be fine.
So anybody out there who knows how to set the horizontal alignment will be greatly appreciated
Here is a small sample of code
B4X:
' csBuilder string
cs.Initialize.Size(20).Typeface(Typeface.CreateNew(Typeface.FONTAWESOME,Typeface.STYLE_NORMAL)).Color(convertGreenColor(oPos.Color)).Alignment("ALIGN_CENTER").Append(oPos.Texte.Replace("2014","2020")).popall
' standard text no cs here
TableView1.DefaultTextColor = convertGreenColor(oPos.Color)
TableView1.DefaultTextBackgroundColor = Colors.White
TableView1.AsView.Width=-2
TableView1.AsView.Height=-2
TableView1.AddTextItem(oPos.Texte, oPos.Link)
' if i use the csBuilder string is
Tableview1.addTextItem(cs,oPos.link)
' instead of oPos.Texte
Any idea anyone
Last edited: