datagrid in iOS scroller (improved questions)

Ken Corey ken at kencorey.com
Fri Mar 23 02:32:21 EDT 2012


On 22/03/2012 21:42, Ken Corey wrote:
> On 22/03/2012 20:02, Michael Doub wrote:
>> I have successfully used form data grids on IOS with no problem. Can
>> you be more clear on the symptoms of your problem?
>>
>> Are you setting the layer mode of the grid to scrolling and
>> AcceleratedRendering of the stack to true?
>>
>> http://livecodejournal.com/forum/viewtopic.php?f=23&t=54
>
> Hi Michael,
>
> Thanks for writing.
>
> The symptom is that when I touch and drag to scroll the formatted area
> of the dataGris scrolls up too without revealing any more of the details
> of itself.

Ah, that's better.  After a night's sleep, I can (hopefully) express 
myself better.

The symptom is that scroll events are used to set the hScroll and 
vScroll of the group, which moves the contents up.

What I want to do is forward the "scrollerDidScroll" method on to the 
datagrid, and let the datagrid handle the scrolling instead of moving a 
group.

Of course, the datagrid needs to be able to talk back to the scroller to 
tell it how big it is, where it is in the total height of its content, etc.

Added wrinkle: The datagrid does not have fixed-height rows.  They are 
variable.  That means that if I'm at the top of a 50 element datagrid, 
and displaying 10, the size of the other 40 haven't been created yet, 
and so I don't know how big they'll be.  I guess I could shoot for an 
average height, and just guess.

So I guess my improved questions would be:
1) How do I send scrollerDidScroll events into a datagrid?
2) How do I tell the scroller how big the datagrid is?
3) BONUS: if I don't have fixed height rows in the datagrid, how can I 
figure out how tall the datagrid is in total?

-Ken




More information about the use-livecode mailing list