UIScroller View its driving me crazy

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jayare
Posts: 12
Joined: Sat Apr 28, 2012 1:34 pm

UIScroller View its driving me crazy

Post by Jayare » Sat Apr 28, 2012 1:39 pm

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

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: UIScroller View its driving me crazy

Post by Klaus » Sat Apr 28, 2012 3:49 pm

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

Jayare
Posts: 12
Joined: Sat Apr 28, 2012 1:34 pm

Re: UIScroller View its driving me crazy

Post by Jayare » Sat Apr 28, 2012 8:49 pm

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

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: UIScroller View its driving me crazy

Post by Dixie » Sat Apr 28, 2012 9:34 pm

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

Jayare
Posts: 12
Joined: Sat Apr 28, 2012 1:34 pm

Re: UIScroller View its driving me crazy

Post by Jayare » Sun Apr 29, 2012 9:42 am

Hello Dixie,

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

Greets
Jochen

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: UIScroller View its driving me crazy

Post by Klaus » Sun Apr 29, 2012 11:25 am

Hi Jochen,

siehste!? :D


Best

Klaus

Post Reply