iOS Question B4XComboBox Text to Left and text color to black

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I am using the B4XComboBox in my project. https://www.b4x.com/android/forum/t...ross-platform-combobox-spinner.89695/#content

When I tap on the ComboBox is pops up with the selection which is fine.

However, when I select an item and it displays it on the page, it shows the selected item but the text is assigned to center and the text is blue.

Is there way in making the text black, and making it left rather than center. I want to keep the popup menu selection text blue and center. Only want to change the text after the item was selected.
 

aaronk

Well-Known Member
Licensed User
Longtime User
You should change it to InitializeCustom and set the colors you like.
That worked.

This will also allow you to change the alignment with btn.CustomLabel.TextAlignment
This failed. I see it aligned to the left for a slit second and then it cantered itself.

I ended up adding the following code to align the text to the left:
B4X:
Dim bno As NativeObject = btn
    Dim myAlignment As Int = 1       ' 0:Center    1:Left     2:Right
    bno.SetField("contentHorizontalAlignment", myAlignment)
 
Upvote 0
Top