Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does UIScrollView like scrolling work?
    primarykey
    data
    text
    <p>in my opinion the iPhone has a big advantage to other smartphones because of its intuitive, smooth and good feeling scrolling components in UIKit. I want to implement a simple game with UIKit which uses this kind of scrolling, but i can't use UIScrollView because it isn't customizable enough.</p> <p>I tried to implement this scrolling myself and tried two different approaches:</p> <ol> <li><p>I used a UIPanGestureRecognizer und moved the bounds of my custom control according to the translation the recognizer delivers me. In order to get this smooth scrolling after lifting my finger during the movement I start an animation. I use the velocity the recognizer gives me and a fixed time in order to calculate how far it should scroll after I lifted my finger. I tryed a linear movement and a ease-out movement, but both looks strange. (more later on that)</p></li> <li><p>I use OnTouchMoved and OnTouchEnded to implement the scrolling. In OnTouchMove I move the bounds according to the movment of the finger. While the finger moves I calculate the difference in location and time of the current and last touch in order to calculate a velocity myself. When the finger lifts I start an animation in OnTouchEnded like in 1. but I use my self-calculated velocity instead.</p></li> </ol> <p>Both approaches are not giving me the results I want. After lifting my finger, the scrolling is not smoothly continued. There seems to be a (sharp) bend in the celocity curve. </p> <p>Has anyone an idea how apple does this smooth scrolling? My current guess is that my interpolation with two really close points is to inaccurate and doesn't take the current acceleration into account.</p> <p>Thx for your thoughts! Kie</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload