Android Question [SOLVED] [B4XComboBox] How to align displayed items to the right?

MegatenFreak

Active Member
Licensed User
Hi. I want the user to see the items listed as aligned to the right side (as it's RTL) when they open the combo box item list.
I've tried the following without success:
1. Setting text horizontal alignment to RIGHT in Designer.
2. Different methods in code:
B4X:
Private CBox As B4XComboBox
'1: (app crashes)
CBox.mBase.SetTextAlignment("CENTER", "RIGHT")
'2: (app crashes)
CBox.mBase.GetView(0).SetTextAlignment("CENTER", "RIGHT")
'3: (app crashes)
Dim jo As JavaObject = CBox.mBase
jo.RunMethod("setNodeOrientation", Array("RIGHT_TO_LEFT"))
I found nothing usable in CBox.cmbBox (spinner) either.
Any ideas?
 
Solution

behnam_tr

Active Member
Licensed User
Longtime User
Hi. I want the user to see the items listed as aligned to the right side (as it's RTL) when they open the combo box item list.
I've tried the following without success:
1. Setting text horizontal alignment to RIGHT in Designer.
2. Different methods in code:
B4X:
Private CBox As B4XComboBox
'1: (app crashes)
CBox.mBase.SetTextAlignment("CENTER", "RIGHT")
'2: (app crashes)
CBox.mBase.GetView(0).SetTextAlignment("CENTER", "RIGHT")
'3: (app crashes)
Dim jo As JavaObject = CBox.mBase
jo.RunMethod("setNodeOrientation", Array("RIGHT_TO_LEFT"))
I found nothing usable in CBox.cmbBox (spinner) either.
Any ideas?

check this code :
B4X:
Dim jo As JavaObject = myComboBox
jo.RunMethod("setNodeOrientation", Array("RIGHT_TO_LEFT"))
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I want the user to see the items listed as aligned to the right side

Did you try CSBuilder (cs) to add the items to the B4XComboBox from a list:
B4X:
l2.Add(cs.Initialize.size(32).Alignment("ALIGN_RIGHT").Append(lstItems.Get(i)).PopAll)   'lstItems is the list, l2 is the new list
 

Attachments

  • B4XComboBoxAlighRight.png
    B4XComboBoxAlighRight.png
    19.6 KB · Views: 159
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
 
Upvote 1
Solution
Top