iOS Question B4XComboBox Text alignment

mcorbeel

Active Member
Licensed User
Longtime User
I am using the B4XComboBox but the text setting in the designer don't have effect on the result. I read somewhere that this is normal. I would like to set the text alignment to LEFT (default is CENTER). I read somewhere that this can be achieved with ActionSheets, but I hope there is a workaround? I previously had a similar issue with the text color and could solve this by using:
B4X:
Dim no As NativeObject = cmb.mBtn
    no.RunMethod("setTitleColor:forState:", Array(no.ColorToUIColor(Colors.Black), 0))
Is there a similar method I can use to set the text alignment?
 

mcorbeel

Active Member
Licensed User
Longtime User
B4X:
Dim no As NativeObject = B4XComboBox1.mBtn
no.SetField("contentHorizontalAlignment", 1)' 0:Center    1:Left     2:Right
Cool thanks. One small remark though... When not expanded the text is now touching the left border. Is there also a way of adding a padding-left value?
 
Upvote 0
Top