Page 1 of 1
IOS Scroller
Posted: Tue Mar 20, 2012 11:35 am
by Nakia
Hi All,
Looking for some example stacks of an IOS Scoller that I want to apply to a Text Fld with varying content
The text in this fld currently changes (including the number of lines of text) so the scroll area of the IOS Scroller needs to change with this and this is where I am stuck..
I currently just have a V Scroll set on the fld and this works fine (adjusts itself to the amount of text in the fld etc) but want to explore using the IOS Scroller in its place.
any assistance that could be provided would be great..
Re: IOS Scroller
Posted: Tue Mar 20, 2012 9:10 pm
by bn
Hi Nakia,
here is an example (albeit a little old) of an iOS scrolling list field:
http://forums.runrev.com/phpBB2/viewtop ... =49&t=6876
is that what you are looking for?
Kind regards
Bernd
Re: IOS Scroller
Posted: Tue Mar 20, 2012 10:10 pm
by Nakia
I will take a look tonight and see..
I suppose what my main question is how I do continually change the scroll area of the scroller as the contents of the fld constantly change?
Re: IOS Scroller
Posted: Tue Mar 20, 2012 10:20 pm
by bn
Hi Nakia,
how I do continually change the scroll area of the scroller as the contents of the fld constantly change?
I suppose you change the content of the field by script, then it is just as you set up the field when starting the scroller. You probably would want to look at the formattedHeight of the field after you have changed content.
Best is to get a feeling for the scrolling list field and look at how it works, then add the variable content.
Kind regards
Bernd
Re: IOS Scroller
Posted: Thu Mar 22, 2012 6:00 am
by FireWorx
Hi,
This seems to work for setting the scroller content rect on the fly. I used a repeat loop to populate 100 lines and played with the scroll settings until the scroll just allowed me to view the 100th line and no more. Then checked the field height in pixels and divided by 100. Turns out 44.25 is the exact number. Here is the script to set the scroll on the fly. NOTE: Your multiplier will be different based on your font, line size, etc so you will have to check it yourself. This is a scroller that is scrolling the field "index List" within the confines of group "Louvers" which has its size and location locked.
On SetTheScrollRectOfMyCoolScroller
put the text of field "Index List" into tEntireList ## grabbing the dynamic content here
filter tEntireList without empty ##get rid of empty lines ## if blank lines are ok then uh oh! Remove this part.
put the number of lines of tEntireList into tLines
if tLines > 6 then ## if more than 6 lines then scroll
multiply tLines by "44.25"
put the round of tLines into tLines
iphoneControlSet sScrollerId, "contentRect", (0, 0, 768, tLines)
set the unboundedVScroll of group "Louvers" to true
else
set the unboundedVScroll of group "Louvers" to false ## don't scroll if less than 6 lines thats the view window
end if
end SetTheScrollRectOfMyCoolScroller