B4A Library [B4X] [XUI] AS WheelPicker - Spinner - a modern single/multiple choice picker view - based on xCustomListView [Payware]

Aldo's

Active Member
Licensed User
Great job.
Thanks.
if I wanted to clean a As WheelPicker how do I do it?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.23
    • Add Clear - Clears a column
      • SetItems already clears the list if you set a new list

Great job.
Thanks
if I wanted to clean a As WheelPicker how do I do it?
You can simply use SetItems with a new list, the WheelPicker automatically empties the list beforehand. Or you can use the new "clear" function. Note, however, that the view crashes if the user scrolls an empty list. So if the list remains empty, remove the column instead of just clearing it.
 

Aldo's

Active Member
Licensed User
HI
I would like to change the font of my AS WheelPicker and I wrote this code:
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    Dim asTmp(3) As String
    asTmp(0)="Ruota intervalli"
    asTmp(1)="Traspositore"
    asTmp(2)="Intonazione voci coro"
    Dim tmp_lst As List : tmp_lst.Initialize
    tmp_lst.AddAll(asTmp)   
    pckMenu.SetItems(0,tmp_lst)
    pckMenu.ItemTextProperties.TextFont=xui.CreateDefaultBoldFont(20)
    pckMenu.Refresh
End Sub

but my font remains the default without changing the size and regular and not bold.
What am I doing wrong?
 

Alexander Stolte

Expert
Licensed User
Longtime User
but my font remains the default without changing the size and regular and not bold.
What am I doing wrong?
If you hover over "ItemTextProperties" property with the mouse, the IDE will show you the comments that I have stored and example code if you have to comply with or observe something special.

In your case, this must be done as follows:
B4X:
Dim ItemTextProperties As ASWheelPicker_ItemTextProperties = ASWheelPicker1.ItemTextProperties
ItemTextProperties.TextFont=xui.CreateDefaultBoldFont(20)
ASWheelPicker1.ItemTextProperties = ItemTextProperties

Alex
 

Aldo's

Active Member
Licensed User
It works perfectly.
Thank you
 

Aldo's

Active Member
Licensed User
Is it possible to create a WheelPicker that puts the first element after the last element in order to create an endless picker?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Is it possible to create a WheelPicker that puts the first element after the last element in order to create an endless picker?
No, sorry.
A solution that I have already seen in a few ios apps is. e.g. Time Picker: simply add the interval 0-23 several times, this creates the illusion for the user that it is "endless". I don't think a user would search for the value "1" more than 20 times.
 

Aldo's

Active Member
Licensed User
Ok, thanks
 

Alexander Stolte

Expert
Licensed User
Longtime User
The problem is that it would be possible if the user always scrolls the list slowly. But as soon as the user scrolls quickly, unexpected behavior on the part of the list cannot be avoided. I had to struggle with this for ages with the AS_Scheduler and even now it is still not 100% perfect.
 

Aldo's

Active Member
Licensed User
I would like to use MaterialIcons for the separator. I wrote this code, but it doesn't insert any comments.

B4X:
    Dim ItemTextProperties As ASWheelPicker_ItemTextProperties = pckNote.ItemTextProperties
    ItemTextProperties.TextFont=xui.CreateDefaultBoldFont(16)
    pckNote.ItemTextProperties = ItemTextProperties
    Dim tmp_lst As List : tmp_lst.Initialize
    tmp_lst.AddAll(asNote)
    pckNote.SetItems(0,tmp_lst)

    Dim SepTextProp As ASWheelPicker_SeperatorProperties = pckNote.SeperatorProperties
    SepTextProp.TextFont=xui.CreateMaterialIcons(16)
    pckNote.SeperatorProperties = SepTextProp
    pckNote.SetSeperator(0,40dip,Chr(0xe5c8))
    
    pckNote.SetItems(1,tmp_lst)
    pckNote.Refresh

What am I doing wrong?
 

Alexander Stolte

Expert
Licensed User
Longtime User
What am I doing wrong?
You're not doing anything wrong. You can test the whole thing by using a label. Set the font of the label to "MaterialIcon" and then add a text + an icon. You will see that only the initial letter and the icon are visible. Since I am using a label, there is nothing I can do if this is the behavior of the native B4A label.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…