Android Question How to set B4XComboBox Items gravity?

Cableguy

Expert
Licensed User
Longtime User
Hi guys,

The tittle kinda says it all... I would like to center the items in the dropdown
 
Solution
The tittle kinda says it all... I would like to center the items in the dropdown
You can use an array of CSBuilders:
B4X:
lstItems.Initialize
    Dim cs As CSBuilder
    lstItems.AddAll(Array As Object(cs.Initialize.Alignment("ALIGN_CENTER").Color(xui.Color_Red).Append("Paris").PopAll, _
    cs.Initialize.Alignment("ALIGN_CENTER").Color(xui.Color_Magenta).Append("Lisbonne").popall, _
    cs.Initialize.Alignment("ALIGN_CENTER").Color(Colors.White).BackgroundColor(Colors.red).Append("Madrid").PopALL))    
    B4XComboBox2.SetItems(lstItems)

Mahares

Expert
Licensed User
Longtime User
The tittle kinda says it all... I would like to center the items in the dropdown
You can use an array of CSBuilders:
B4X:
lstItems.Initialize
    Dim cs As CSBuilder
    lstItems.AddAll(Array As Object(cs.Initialize.Alignment("ALIGN_CENTER").Color(xui.Color_Red).Append("Paris").PopAll, _
    cs.Initialize.Alignment("ALIGN_CENTER").Color(xui.Color_Magenta).Append("Lisbonne").popall, _
    cs.Initialize.Alignment("ALIGN_CENTER").Color(Colors.White).BackgroundColor(Colors.red).Append("Madrid").PopALL))    
    B4XComboBox2.SetItems(lstItems)
 
Upvote 1
Solution
Top