Note that there are some explanatory texts on larger screens.

plurals
  1. POUIScrollView inifinite scroll without paging
    primarykey
    data
    text
    <p>first question here, be nice :P</p> <p>I am trying to make an infinite UIScrollView (i used the "StreetScroller" apple demo project). When the UIScrollView is almost at the end of the contentSize, the contentOffset is set to the center of the contentSize and all the subviews are moved so it is transparent for the user.</p> <p>It works correctly when you scroll slowly, but when you scroll too fast and that you reach the end of the UIScrollView, things become weird. </p> <p>In my case i use a UIScrollView with frame.size.width = 320 and contentSize.x = 3 * frame.size.width. And this is what happen in the logs when you scroll too fast and that you reach the end of the contentSize (so if x > 560 when scrolling to the right) :</p> <p>--> The UIScrollView is scrolling because of inertia</p> <pre><code>SetContentOffset called width x : 504.730072 SetContentOffset called width x : 516.878967 SetContentOffset called width x : 528.489990 SetContentOffset called width x : 540.347656 SetContentOffset called width x : 550.754028 SetContentOffset called width x : 561.200378 </code></pre> <p>--> The UIScrollView reach the end of the contentSize so we recenter</p> <pre><code>The next call of setContentOffset is for recentering the view SetContentOffset called width x : 320.000000 </code></pre> <p>--> Here is the problem, UIScrollView does not take contentOffset.x changes in account, it continues the animation with the last contentOffset.x value used....</p> <pre><code>SetContentOffset called width x : 571.421753 The next call of setContentOffset is for recentering the view SetContentOffset called width x : 320.000000 SetContentOffset called width x : 581.283447 The next call of setContentOffset is for recentering the view SetContentOffset called width x : 320.000000 SetContentOffset called width x : 610.100952 </code></pre> <p>And this continues until the animation finishes.</p> <p>If somebody has a solution for setting the contentOffset and forcing UIScrollView to update its animation :)</p> <p>I read almost all the topic on stackoverflow and other websites about infinite UIScrollView, and i did not see any working solution to change the contentOffset during the animation, and i tried to recenter in all the different UIScrollView delegate methods. And i don't want to change the contentSize during scrolling (it works only when you scroll at right or bot...)</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.
 

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