Mobile scrolling issues

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Posts: 199
Joined: Thu Sep 19, 2013 10:08 am

Mobile scrolling issues

Post by istech » Mon May 27, 2024 2:03 pm

Hi All,

I do hope all are doing well.

I have a strange issue I would love to get a second take on.

I have created a scrolling group which works mostly as expected side 2 issues. The first being that upon initial launch of the app the scrolling group does not scroll correctly. It kind of starts moves a little then stops when you try to scroll with it. The kicker is when you leave the card then come back to the card all work perfectly. This only happens on initial launching of the app which leads me to removing all the startup functions but still no go on resolving it or tracking it down. I have been watching the message watcher and "uAllowConstraindrag" function is called which has not related to the scrolling group(I think). I find it very odd and interested in if anyone has had a simular issue and how it was resolved. Maybe i'm doing something wrong here.

My second issue is sensitivity of the scrolling function. I find it very hard to scroll and not select a button when scrolling. Any suggestions on this matter would be great.

IOS 17 simulator
Livecode 9.6.11
xcode 15

Code: Select all

on touchstart
   ## Allow the group to scroll
   put true into sScrolling
   ## Record the initial touch position
   put item 1 of the mouseLoc into sInitialMouseX
   put item 2 of the mouseLoc into sInitialMouseY
   ## Record the initial hScroll and vScroll
   put the vScroll of me into sInitialVScroll
   put the hScroll of me into sInitialHScroll
end touchstart

on touchMove tID, mouseX, mouseY
   ## If the screen is being touched then
   if sScrolling then      
      ## Calculate how far the touch has moved since it started
      put mouseY - sInitialMouseY into tVChange
      #put mouseX- sInitialMouseX into tHChange
      ## Reset the hScroll and vScroll to follow the touch
      lock screen
      set the vScroll of me to sInitialVScroll - tVChange
      #set the hScroll of me to sInitialHScroll - tHChange
      #put the hScroll of me into lastPoint
      unlock screen
   end if
end touchMove

on touchRelease
end touchRelease

on touchend
   put false into sScrolling
end touchend 

on mouseEnter
end mouseEnter

Post Reply

Return to “iOS Deployment”