Spinner

derez

Expert
Licensed User
Longtime User
I can't get a response from a spinner and I don't understand why.
I have a spinner defined, initialized, allocated it content and I get the list displayed when pressing on the arrow.

B4X:
tgtspin.Initialize(tgtspin)
Activity.AddView(tgtspin,140dip,0,40dip,38dip)
....
For i = 1 To route.Size
  tgtspin.Add("Target # " & i)
Next
tgtspin.Enabled = True

The event sub is not entered at item click:

B4X:
Sub tgtspin_ItemClick (Position As Int, Value As Object)
tgtno = tgtspin.SelectedIndex + 1
tgtlabel.Text = tgtspin.SelectedIndex + 1
 
'tgtno = position + 1
'tgtlabel.Text = position + 1
End Sub

(I tried two options until I found that it does not enter).:sign0085:
 

derez

Expert
Licensed User
Longtime User
Thank you.
I did everything right except this - tgtspin.Initialize(tgtspin),
it should be tgtspin.Initialize("tgtspin")
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Erel

some views (like the spinner) will not function fully unless they are added to the activity by code.
If I design them by the visual designer and add them by code I get an error and have to delete them from the designer.

this means that the designer is only good for puting the view in place.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
In what way does a spinner not function? You should be able to add one in the designer and use Tools -> Generate Members to put a Dim line in Sub Globals and an event Sub if needed. The event name can be entered in the designer properties panel before generating the required members.
 
Upvote 0

sterlingy

Active Member
Licensed User
Longtime User

Derez,

This was helpful to me. I was having problems until I added the Spinner in code instead of the Designer.

Thanks!!!!

:sign0098:

Sterling
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…