hi, i'm experiencing a strange behaviour of my scrollers
i got a stack with two scroller in two different cards
both controls works well with the code i found here
the strange thing is that the second control, with his own variables names, field names, group names and so on, uses the rect of the other control
the first control is:
Code: Select all
set the unboundedHScroll of group "scroller" to false
set the unboundedVScroll of group "scroller" to true
put the formattedheight of fld "reader" into altezzareader
set the rect of cd fld "reader" to (0,50,320,altezzareader+50)
iphoneControlCreate "scroller"
put the result into sScrollerId
iphoneControlSet sScrollerId, "visible", "true"
iphoneControlSet sScrollerId, "canBounce", "true"
iphoneControlSet sScrollerId, "pagingEnabled", "false"
iphoneControlSet sScrollerId, "canScrollToTop", "true"
iphoneControlSet sScrollerId, "indicatorStyle", "white"
-- contentRect refers to the rect of the field that appears within the scroll control
iphoneControlSet sScrollerId, "contentRect", (0,0,320,altezzareader)
-- set rect of the scroller area
iphoneControlSet sScrollerId, "rect", (0,50,320,480)
the second control is:
Code: Select all
set the unboundedHScroll of group "indicescroller" to false
set the unboundedVScroll of group "indicescroller" to true
put the formattedheight of fld "indice" into altezzareader
--put "" into fld "righe"
set the rect of cd fld "indice" to (0,50,320,altezzareader+50)
iphoneControlCreate "scroller"
put the result into indicereader
-- general properties
iphoneControlSet indicereader, "visible", "true"
iphoneControlSet indicereader, "canBounce", "true"
iphoneControlSet indicereader, "pagingEnabled", "false"
iphoneControlSet indicereader, "canScrollToTop", "true"
iphoneControlSet indicereader, "indicatorStyle", "white"
-- contentRect refers to the rect of the field that appears within the scroll control
-- the last 2 values in the rect are the width and height of the field that is being scrolled
-- the last value can be set programatically or be hard coded (as I have here) to account for more or less
-- text in the field.
iphoneControlSet indicereader, "contentRect", (0,0,320,altezzareader)
-- set rect of the scroller area
-- vary these values to make the scroller control appear just where you want it to
-- in this case it appears 88 px from the top of the screen, and is positioned up against the other 3 edges of the screen.
-- To move the bottom of the scrolling area upwards change the last value
-- of the following line of code e.g. change "the bottom of this card " to "the bottom of this card -88" or whatever
iphoneControlSet indicereader, "rect", (0,50,320,400)
the result is that the control covers all the screen from 50pixels from the top to the bottom of the screen, like a overlay, when i scroll the field to the bottom of the list the contento of the field "slide" over the buttons on the bottom of the card and reveals it, but if i tap outside the teorethical rect of the control the scroller don't scroll
i need a scoller with a rect of 0,50,320,400 for a really higher field desperately!
so the rect of the control draws the area within the fingers can scroll the field but DON'T draws the visibile rect of the field under the scroller
it seems like another rect is missing, like the iphoneControlSet "rect" set the interactive area but not the viewable area of the scroller content either
i'm exausted, i don't have any idea about it, but i NEED to solve this... i need a scoller with a rect of 0,50,320,400 for a really higher field desperately!
at least, if someone would be so kind to make me a little stack to let me see where i'm wrong...
i'm not sure i'm clear, it's not so easy to me write in english, i hope you understand
thanks in advance once again
update: some images to make it clear