iOS Question Picker

Erel

B4X founder
Staff member
Licensed User
Longtime User
There isn't a full tutorial about Picker. You can see an example here: https://www.b4x.com/android/forum/threads/example-coordinates-calculator-source-code.46851/#content

It is quite simple to use Picker.
See this example:
B4X:
Sub Process_Globals
   Public App As Application
   Public NavControl As NavigationController
   Private Page1 As Page
   Private Picker1 As Picker
End Sub

Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Initialize("Page1")
   NavControl.ShowPage(Page1)
   Page1.RootPanel.LoadLayout("1")
   Picker1.SetItems(0, Array(1,2,3,4,5))
   Picker1.SetItems(1, Array("One", "Two", "Three", "Four", "Five"))
End Sub

Sub Picker1_ItemSelected (Column As Int, Row As Int)
   Log("Selected item in column: " & Column & " is: " & Picker1.GetSelectedItem(Column))
End Sub

Make sure to create a layout file with a picker named Picker1.

upload_2015-3-19_8-50-42.png
 
Upvote 0
Top