gpt4 book ai didi

ios - 使用三个 View 的无限循环对 UIScrollView 进行分页

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:26:05 24 4
gpt4 key购买 nike

我想创建一个具有三个常量 View 的 UIScrollView。中间 View 应该始终在初始时显示。当用户向右滚动时,View 1 将成为事件 View ,而其他两个 View 将像循环一样移动:View 3 现在将在左侧,而 View 2 在右侧。附图说明了我要的:

这可能吗?

最佳答案

3 Pages Only

There may be times when you want an infinite page loop, but don’t want to load in a lot of content. For example, You may have a lot of content to display inside the UIScrollView. Loading large amounts of data there would not be the ideal approach to the situation.

The logic that we can use there is to keep the UIScrollView at just three pages. Data would load on each page and the user would always be looking at the data in the middle page. When the user scrolled to a new page, the content for each page would be reset and the offset would go back the user is back to viewing the middle page. That way even though you may have a large amount of data to scroll through, it’s not all loaded at once. Only three pages are ever loaded at one time.

...取自http://iosdevelopertips.com/user-interface/creating-circular-and-infinite-uiscrollviews.html

关于ios - 使用三个 View 的无限循环对 UIScrollView 进行分页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6789087/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com