My list view presents a stack of cards that is scrolled horizontally. At most, three cards are visible in the view with the outer most cards on the left and right fading in and out as a function of the user scrolling horizontally.
I calculate which cards are suppose to fade-in/out as the user scrolls utilizing the internal list view API to check and continually update redux state as a result.
The problem is the scrolling animation experience is inconsistent. It jitters when I scroll sometimes and other times it is smooth. Sometimes the fade in out functionality bugs out or updates a few seconds later after a scroll. What gives?
Is jittery animation normally expected when the redux state is updated frequently?
Related
Alright, so I have drag and drop added onto a stack view contained within a scroll view. Drag and drop works just fine. Here is the code (done via a gesture recognizer on the stack view).
The problem is the list can get big enough such that the items become scrollable. This means as the user is dragging they should be able to scroll simultaneously like most apps do — item is dragged close to top/bottom and scroll view scrolls in that direction.
I tried using UIView.animate(...) block — didn't work. The animation worked exactly as you'd expect, but the item that was being dragged immediately disappears upon initiation of the animation; and I am using the 'allows user interaction' flag. That solution would have been great as I can set a duration on it that establishes the speed at which it should scroll up or down. And cancelling seemed straightforward enough. And when I say disappears, I mean it's as if the item was dropped wherever the user happened to be holding it at the time the animation began despite not actually lifting your finger and actually dropping.
So I decided to take another approach, instead of leaning on UIView.animate(...), I'm going to manually change the offset of the scrollview in minute amounts to make it appear to scroll smoothly. And I'll execute those small changes at a frequency that results in the scrolling speed that I want.
The problem with that is currently I just do it in a loop, and inside that loop it sleeps depending on how fast I want the scroll to occur; see this SO question for a description of the implementation. But the problem with it is it's actually dependent on both time (the sleep duration) and the speed of the processor. The smaller the duration gets the less of an effect that the duration has on the scrolling speed, until it's zero where the only inhibiting factor is the speed at which the CPU can execute those instructions.
I'm looking for a solution that will allow me to specify the speed (points per second), at which the scroll view will move. However, the for loop solution only specifies the duration between consecutive offset changes. It doesn't actually take into account the time it takes for the scrolling to actually occur. Not like UIView.animate(...) appears to do. In that case, if I specify that the duration should be 3 seconds and it should go from content Y offset of 300 to 0. Then I expect it to scroll 300 points in 3 seconds, or 100 points per second.
How can I effect a definitive approach to scrolling speed like UIView.animate(...) seems to provide, but without using that API, as it appears to interfere with the touch event?
I need to scroll to bottom in tableview with many rows without freeze.
I have talbeview with infinity scroll (when user scrolls down, app makes request and fetches new part of data). When i'm trying to scroll to bottom by settig table's content offset or by scrollToRow, app freezes and i see cpu usage 100%, and ram up to 100mb (in normal state it is only 10mb).
I guess this is because of cell rendering. I was trying to set async rendering, or rendering with queue, but nothing.
This problem is seems like Scrolling bottom in tableview and performance but there is no answer.
So I am trying to figure out how to make a circular scrolling system. So I have for example a wheel like this http://static.cubiq.org/uploads/2009/04/Rotating-wheel.jpeg and you scroll between options (like an old school ipod) Now I currently already have this working with positions. So I have positions 1-6 and as you scroll down, it moves everything down a position and I animate this transition. I am wondering if there is a way to do this using the actual scroll function. So that you can scroll up and down freely while holding down, rather then doing up or down actions and waiting for animation.
So given that information how could I convert a standard vertical scroll up->down and down->up into a circle structure. Thanks for any info
I have written an efficient parallax script that is very smooth on mobile. However, it is only smooth if I am scrolling with my finger on the screen. When scrolling with my finger on the screen, the parallax is smooth. But the second I take my finger off and let the inertia take over, it starts lagging. But only when the inertia takes over. I'm thinking if there is some kind of scroll event that is fired often during inertial scroll. It does not appear to be the script causing the lag, it is more to do with the fact that the scroll event or whatever scroll event I've tried does not fire as often during inertial scrolling. I've tested this theorem by measuring the amount of time that has passed from one scroll event to another. The result was that scroll events fire no less frequently when parallax is being calculated and applied versus an event where it is not.
Essentially, what I'm asking for is an event that is fired just as many times during inertial scroll as when the finger is on the screen and dragging.
Thanks in advance.
I have a horizontal scroll view with paging enabled, and the children of this scroll view are vertical scroll views. It's like the iOS home screen, but imagine scrolling vertically on each home screen.
Now, when the vertical scroll is in progress, it's hard to swipe to the next or previous screen, because the vertical scroll view apparently captures the events. Even if the angle of the swipe is almost horizontal, it doesn't go to the next or previous "page". Only after the scroll stops fully can one easily swipe to the next or previous pages.
Unfortunately, because of the slow deceleration, the user might think the content stopped moving when it is in fact moving very slowly and just about to stop. But the horizontal swipe is interpreted as a vertical scroll gesture, and the scroll velocity increases, making things worse from the user's perspective.
I've noticed multiple people struggling with this when they test out our app, and I wonder if anyone here knows a solution, perhaps a way to consider the angle of the swipe to determine which scroll view should process the event. Thanks.
I would suggest stopping the vertical scroll on a touch begins event. This is how most apps I've seen do something like this.