pageview jumpto而不会解散用户的动画 /输入
我正在尝试在用户更改页面时纠正我的页面浏览量的页面。 不幸的是,所有可能的页面更改操作(jumpto()
,animateto()
,jumptopage()
)解散当前的用户输入(或animation) 。看起来像:
- 输入:用户将下一页拖动到
- 编程更改:在页面更改期间调整操作称为
- 当前输出:当前的阻力被置于并且页面跳跃(或动画)无需考虑进一步的用户输入所需页面的进一步输入
,而用户对pageview进行动画操作,是否有任何方法可以更改页面?因此,输出可能看起来像:
- 所需的输出:当前阻力正在保留,并且页面只会更改。用户仍然可以继续拖动。
I am trying to correct a page of my PageView, while the user is changing pages.
Unfortunately, all possible page change operations (jumpTo()
, animateTo()
, jumpToPage()
) dismiss the current user input (or animation). Which looks like:
- Input: user drags to next page
- Programatical change: during page change page adjust operation is called
- Current Output: Current drag is dismissed and the page jumps ( or animates) without any regard to further user input to the desired page
Is there any way to change pages, while the user animates the pageview? So that the output might look like:
- Desired Output: Current drag is being kept and the page only changes. User still can continue to drag.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常的操作否定了所有动画和用户输入。如文档中所述:
为了归档您要做的事情,您可以使用以下类扩展名:
现在您可以调用
SmoothJumpto()
就像jumpto()
,但无需解雇活动动画,例如用户输入。The usual operations dismiss all animation and user inputs. As also described in the documentation:
In order to archive what you are trying to do you can use the following class extension:
Now you can call
smoothJumpTo()
just likejumpTo()
but without dismissing active animations, such as the user input.我改进了@Paul的答案,感谢他。在DART中,在这种情况下,使用扩展程序更方便。正确的像素不会取消任何动画或动作。
I improved @Paul's answer, thanks to him. In dart, it's more convenient to use extension in this case. Correct pixels doesn't cancel any animations or actions.