B4J Question PreferenceDialog - Options field - center/left/right

DarkoT

Active Member
Licensed User
Hi, Need little help. I'm using a preference dialog which loads Json structure for input data and have little problem with displaying choice options. Is possible to define the position of the chosen option; now is the right aligned. Can I define the left, center, right alignment of choice item?

 
Solution
B4X:
'p is the B4XPreferencesDialog
Dim rs As Object = p.ShowDialog(Data(0), "Ok", "CANCEL")

For i = 0 To p.PrefItems.Size - 1
    Dim pi As B4XPrefItem = p.PrefItems.Get(i)
    If pi.ItemType = p.TYPE_OPTIONS Then
        Dim lbl As B4XView = p.CustomListView1.GetPanel(i).GetView(1)
        lbl.SetLayoutAnimated(0, lbl.Parent.Width - 300dip, lbl.Top, 290dip, lbl.Top)
        lbl.SetTextAlignment("CENTER", "CENTER")
    End If
Next

Wait For (rs) Complete (Result As Int)

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
'p is the B4XPreferencesDialog
Dim rs As Object = p.ShowDialog(Data(0), "Ok", "CANCEL")

For i = 0 To p.PrefItems.Size - 1
    Dim pi As B4XPrefItem = p.PrefItems.Get(i)
    If pi.ItemType = p.TYPE_OPTIONS Then
        Dim lbl As B4XView = p.CustomListView1.GetPanel(i).GetView(1)
        lbl.SetLayoutAnimated(0, lbl.Parent.Width - 300dip, lbl.Top, 290dip, lbl.Top)
        lbl.SetTextAlignment("CENTER", "CENTER")
    End If
Next

Wait For (rs) Complete (Result As Int)

 
Upvote 0
Solution

DarkoT

Active Member
Licensed User
Tnx @Erel, this works perfects...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…