I need to use ScrollView to display some information that I am pulling from a SQLite database. I would like to know if I need to have the data that is displayed in a group to be able to use scroll view. If I do, could you please provide some sample code that I could use to insert the data into the ScrollView?
Scrollview itself is a group. You basically need to call display.newText and insert it into the scrollView. You can then read values from your db and update display.newText.text
Thanks for the help, things are working well, to a point. I have the text that I am pulling from a database being inserted to the Scroll View. But the last 5 or 10 lines of data are not showing at the bottom of the scroll. You can see them in the “bounce” (for a lack of a proper term) when you attempt to scroll past the bottom of the scroll max.
Here is what I have inserting the data into the
for row in db:nrows(sql) do
if row.data == nil then
print(" NO DATA FOUND ")
end
count = count +1
local dbText = row.data1…" - "…row.data2
Ok. now that we see the type of data you’re working with, I agree with Rob. This data representation probably will be served better with a tableView. I typically use a scrollView for a detail window. For a tabular list its best to go with tableView. See ListView1 or 2 samples from CL Samples and you can easily adapt your code to work with a tableView.
In the meanwhile, if you wish the scrollView to work perhaps you need to try the following parameters in your scrollView constuct :
bottomPadding = 50,
scrollHeight = 800 (or something that will fit your need)…
We generally don’t give dates because when we have in the past, something has come up that delayed it. And with everyone taking their holiday vacation breaks…
Scrollview itself is a group. You basically need to call display.newText and insert it into the scrollView. You can then read values from your db and update display.newText.text
Thanks for the help, things are working well, to a point. I have the text that I am pulling from a database being inserted to the Scroll View. But the last 5 or 10 lines of data are not showing at the bottom of the scroll. You can see them in the “bounce” (for a lack of a proper term) when you attempt to scroll past the bottom of the scroll max.
Here is what I have inserting the data into the
for row in db:nrows(sql) do
if row.data == nil then
print(" NO DATA FOUND ")
end
count = count +1
local dbText = row.data1…" - "…row.data2
Ok. now that we see the type of data you’re working with, I agree with Rob. This data representation probably will be served better with a tableView. I typically use a scrollView for a detail window. For a tabular list its best to go with tableView. See ListView1 or 2 samples from CL Samples and you can easily adapt your code to work with a tableView.
In the meanwhile, if you wish the scrollView to work perhaps you need to try the following parameters in your scrollView constuct :
bottomPadding = 50,
scrollHeight = 800 (or something that will fit your need)…
We generally don’t give dates because when we have in the past, something has come up that delayed it. And with everyone taking their holiday vacation breaks…