Page 1 of 1

UIScroller View its driving me crazy

Posted: Sat Apr 28, 2012 1:39 pm
by Jayare
Hello everybody,

i have created a simple sample stack by using all the great examples here in this forum. But unfortunately i do not get the UIScroller view to work. This is driving me crazy, i have searched all my scripts and content. Can somebody tell me what i'm doing wrong.

My sample file is added to this post.

Thanks a lot
Greets from germany
Jochen

Re: UIScroller View its driving me crazy

Posted: Sat Apr 28, 2012 3:49 pm
by Klaus
Hi Jochen,

welcome to the forum! :D

I think you need a certain amount of postings before you can add attachments.
But you could post your code here...


Best

Klaus

Re: UIScroller View its driving me crazy

Posted: Sat Apr 28, 2012 8:49 pm
by Jayare
Hello Klaus,

thanks for your information. Here is my code:
In the iPhone simulator the scrolling list field "scrollerfeld" does not change to a IOS native scroller :? :?

local sScrollerId

on preOpenCard
if the environment is not "mobile" then
exit preOpenCard
end if

-- Create the scroller and store its id
iphoneControlCreate "scroll"
put the result into sScrollerId

iphoneControlSet sScrollerId, "rect", the rect of group "scrolleranzeige"
iphoneControlSet sScrollerId, "contentRect", (0, 0, 1600, 1200)
iphoneControlSet sScrollerId, "visible", "true"
iphoneControlSet sScrollerId, "canBounce", "true"
iphoneControlSet sScrollerId, "canScrollToTop", "true"



end preOpenCard

on closeCard
if the environment is not "mobile" then
exit closeCard
end if

iphoneControlDelete sScrollerId
end closeCard


on doAction pAction
iphoneControlDo sScrollerId, pAction
end doAction

on doSetProp pProp, pValue
iphoneControlSet sScrollerId, pProp, pValue
end doSetProp


I hope anybody can help me!

Greets
Jochen

Re: UIScroller View its driving me crazy

Posted: Sat Apr 28, 2012 9:34 pm
by Dixie
hi...

You need to handle the scrollerDidScroll message... it is sent when the scroll properties change.
for example:-

Code: Select all

on scrollerDidScroll hOffset, vOffset
   set the vScroll of group "scrollGroup" to vOffset
end scrollerDidScroll
be well,

Dixie

Re: UIScroller View its driving me crazy

Posted: Sun Apr 29, 2012 9:42 am
by Jayare
Hello Dixie,

thanks for the missing code parts! Now the magic happens!
Thanks a lot you saved me hours.

Greets
Jochen

Re: UIScroller View its driving me crazy

Posted: Sun Apr 29, 2012 11:25 am
by Klaus
Hi Jochen,

siehste!? :D


Best

Klaus