Spinner entry limits??

SarahWard

Banned
I have found that the Spinner view seems to have a limitation of about 250 entries, or thereabouts.

I am trying to load over 500 entries into the spinner. Is this a hard limitation and would another view work better?
 

SarahWard

Banned
There is no hard limit. Which error do you get?

Hi Erel

I don't actually get an error. I load in over 500 names from a text file but only about 250 display in the spinner at runtime. Is it a List problem? I have been using a list to add them. Maybe I should use readline and do it line by line?

This code loads three values per record (reference int, name string, name-latin string) and it only displays the first about 250-ish records even though there are about 520 records...

words = File.ReadList(File.DirRootExternal, sdcard_folder & indexis)
y = 1
For x = 0 To Index_size - 1 Step 3 'the 0 relates to the first entry in the file in .get(0)
REFis(y) = words.Get(x) 'record ref
NameCommonis(y) = words.Get(x+1) 'common name
spinnerItems.Add(NameCommonis(y))
NameLatinis(y) = words.Get(x+2) 'latin name
y = y + 1 'y counts thru the actual records
Next
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is impossible to help without seeing your complete project.

Just to be sure I created a small test that adds 2000 items and it works properly:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim s As Spinner
   s.Initialize("s")
   For i = 1 To 2000
      s.Add("item " & i)
   Next
   Activity.AddView(s, 0, 0, 200dip, 100dip)
End Sub
 
Upvote 0

SarahWard

Banned
It is impossible to help without seeing your complete project.

Just to be sure I created a small test that adds 2000 items and it works properly:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim s As Spinner
   s.Initialize("s")
   For i = 1 To 2000
      s.Add("item " & i)
   Next
   Activity.AddView(s, 0, 0, 200dip, 100dip)
End Sub

Thankyou, Erel

It seems that the limitation went away when I stopped populating the spinner via a list view as per your code. I don't know for sure the list view was causing it but it works now. Thanks. :)
 
Upvote 0
Top