mcorbeel Active Member Licensed User Longtime User Sep 21, 2024 #1 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?
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?
Alexander Stolte Expert Licensed User Longtime User Sep 21, 2024 #2 B4X: Dim no As NativeObject = B4XComboBox1.mBtn no.SetField("contentHorizontalAlignment", 1)' 0:Center 1:Left 2:Right Upvote 0
B4X: Dim no As NativeObject = B4XComboBox1.mBtn no.SetField("contentHorizontalAlignment", 1)' 0:Center 1:Left 2:Right
mcorbeel Active Member Licensed User Longtime User Sep 21, 2024 #3 Alexander Stolte said: B4X: Dim no As NativeObject = B4XComboBox1.mBtn no.SetField("contentHorizontalAlignment", 1)' 0:Center 1:Left 2:Right Click to expand... 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
Alexander Stolte said: B4X: Dim no As NativeObject = B4XComboBox1.mBtn no.SetField("contentHorizontalAlignment", 1)' 0:Center 1:Left 2:Right Click to expand... 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?
Alexander Stolte Expert Licensed User Longtime User Sep 21, 2024 #4 mcorbeel said: Is there also a way of adding a padding-left value? Click to expand... B4X: no.RunMethod("setContentEdgeInsets:", Array(no.MakeEdgeInsets(10, 0, 0, 0))) Upvote 1
mcorbeel said: Is there also a way of adding a padding-left value? Click to expand... B4X: no.RunMethod("setContentEdgeInsets:", Array(no.MakeEdgeInsets(10, 0, 0, 0)))
mcorbeel Active Member Licensed User Longtime User Sep 21, 2024 #5 Great, thank you, appreciate it... Upvote 0