iOS: UIScrollView and scrollable Data Grid

Giulio Mastrosanti giulio at cantoberon.it
Wed Apr 20 06:02:19 EDT 2011


Hi ll,

I'm starting to play with iOS development,
my first need for my project is to have a scrollable Data Grid, scrolling it on a 'native' way and avoiding to have its custom scrollbars visible.

and indeed i have almost reached the point, following some steps of the Scroller Example.( it shows how to scroll a group containing images )

for my first test I did the following:

1) I created a group containing the Data Grid and another invisible ( a line ) control;
2) I prefilled the Datagrid with a list of text lines;
3) I set the height of the datagrid to  show all its content;
4) I created from code a new scroller, set its rect to match the visible scrolling area, and its contentRect to to match the measures of the Data Grid.

it works fine! 
I have a scrolling iOS native looking list, with the vIndicator and bouncing and all the stuff... 

The next steps for having a dynamic filled Data Grid would be:

1) fill the Data Grid from code;
2) set its height to make visible all its content;
3) set the contentRect of the created scroller to match the height of the content of the Data Grid.

but now I'm wondering, before approaching the next steps, maybe I'm accomplishing the thing on a comp'licated way?
maybe there's a simples way to a have get the goal, or ( better ) some example out there?

thanks for your attention,

     Giulio


More information about the use-livecode mailing list