有没有办法扑来,让PageView跳过当前屏幕和新选择的屏幕之间的屏幕?

发布于 2025-02-02 16:21:19 字数 208 浏览 3 评论 0原文

我有一个带有5个屏幕的pageView,当我从屏幕[0]开始时,动画播放到屏幕[4]时,它也加载了它们之间的所有屏幕,并简要显示它们。

结果是在每个“中间”屏幕上都调用了Initstate,这些屏幕仅在AnimateTapage Animation的屏幕上非常简短地显示,这是我不想要的。

无论如何,是否可以跳过“中间”页面,或者只是在动画播放时根本不让它们加载?提前致谢。

I have a PageView with 5 screens in it, when I start at screen [0], and animateToPage over to screen [4], it loads all the screens between them as well and also shows them briefly.

The consequence is that initState is called on each of those 'in-between' screens that are only very briefly shown on screen in the animateToPage animation, which is what I don't want.

Is there anyway to skip the 'in-between' pages, or just not let them load at all while the animateToPage is playing? Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坚持沉默 2025-02-09 16:21:19

使用“ jumptopage”而不是“ animateTopage”
或使用像该图像的“ pagecontroller”
在此处输入图像描述

use "jumpToPage" instead of "animateToPage"
Or use "PageController" like that image
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文