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:
Code: Copy
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
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:
Code: Copy
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: Copy
Dim jo As JavaObject = myComboBox
jo.RunMethod("setNodeOrientation", Array("RIGHT_TO_LEFT"))
 
Upvote 0
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:
Code: Copy
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: 635
Upvote 1
 
Upvote 1
Solution

Similar Threads

  • Question Question
Android Question B4XComboBox
Replies
2
Views
2K
  • Question Question
Android Question B4XComboBox
Replies
8
Views
3K
Replies
0
Views
3K
Replies
1
Views
3K
Back
Top