I have a view with several B4XComboBox views. I populate the B4XComboBox view with a list of values. For some reason the text color of the selected B4XComboBox is always white. If I change the color with xxxx.cmbBox.TextColor = Colors.Red then the color of the dropdown list text changes (I thought that was supposed to be the DropdownTextColor property!) but the main box with the selected value remains white - so obviously can't be seen.
genOverride.cmbBox.Color = Colors.White
genOverride.cmbBox.TextColor = Colors.Black
genOverride.cmbBox.DropdownBackgroundColor = Colors.White
genOverride.cmbBox.DropdownTextColor = Colors.Black
Dim Items As List
Items.Initialize
Items.Add("No")
Items.Add("Yes")
genOverride.SetItems(Items)
Result:
The dropdown background is white, text is black
Combobox background is white, text is not shown - I changed the Color to non-white and still no text.
In the changed event the text is read correctly, as is the index:
B4X:
Private Sub genOverride_SelectedIndexChanged (Index As Int)
Log("Index=" & Index)
Log("Val:" & genOverride.cmbBox.GetItem(Index))
End Sub
Ok, after some investigation I found the 'problem' which appears to be the width of the view.
With entries Yes/No at font size 10, anything less than a width of 72 causes the Yes to truncate to Y..
With setting of 73 it's ok. I have height at 20 which is also ok.
It seems the container for the view is occupying a large amount of the view.
Is there a way to change this and 'recover' the blank space?