Android Question Formatting Text Color of B4XComboBox

Kevin Hartin

Member
Licensed User
B4X:
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
    mBase = Base
    Dim xlbl As B4XView = Lbl
#if B4J
    cmbBox.Initialize("cmbBox")
    Dim xbox As B4XView = cmbBox
    xbox.Font = xlbl.Font
    mBase.AddView(cmbBox, 0, 0, mBase.Width, mBase.Height)
#Else If B4A
    cmbBox.Initialize("cmbBox")
    cmbBox.TextSize = xlbl.TextSize
    cmbBox.TextColor = xlbl.TextColor
    cmbBox.DropdownBackgroundColor = xlbl.Color
    mBase.AddView(cmbBox, 0, 0, mBase.Width, mBase.Height)
#Else If B4i
    Dim btn As Button
    btn.Initialize("btn", btn.STYLE_SYSTEM)
    mBtn = btn
    mBtn.Font = xlbl.Font
    mBase.AddView(mBtn, 0, 0, mBase.Width, mBase.Height)
#End If
   
End Sub
How can I set the DropdownBackgroundColor to the same as the ComboBox color?
 
Last edited:

Kevin Hartin

Member
Licensed User
My combined when it expands is black, which does not work on a white screen with black text.

The text of the dropdown is the same color as the text in the view. As set in the designer with the addition of cmbBox.TextColor = xlbl.TextColor to the DesignerCreateView sub.

I am trying to set the combined dropdown background color using cmbBox.DropdownBackgroundColor = xlbl.Color. but this does not seem to work.
 
Top