Android Question Spinner (B4A)

ciginfo

Well-Known Member
Licensed User
Longtime User
Where can I find a tuto or example with the view "Spinner"?
Thank you
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Spinners are quite simple to use.

Create a layout with a spinner named Spinner1:
B4X:
Sub Globals
   Private Spinner1 As Spinner
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("1")
   Spinner1.AddAll(Array("Item 1", "Item 2", "Item 3"))
End Sub

Sub Spinner1_ItemClick (Position As Int, Value As Object)
   Log("User clicked on " & Value)
End Sub
 
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
Thank You, but:
1°)Position begins at 0 or at 1
2°) How to check default position?
Thank you
 
Upvote 0
Top