使用 UiScrollview 分页并渲染下一页
根据 PhotoScroller 示例,我已经实现了带有分页的 UIScrollView。
但是,我无法让它很好地工作。我使用加载 XIB 的 viewController。但是,当滚动页面时,直到它完全在视图中时才会真正更新(因此它似乎不会用数据渲染布局,直到它完全在视图中)
我在 Loadview 上加载数据(因为 viewWillAppear 似乎永远不会被调用 )在这种情况下)。 有什么建议我如何在创建视图时呈现整个视图,以便在滚动到它时显示它?我不知所措,认为我几乎尝试了所有方法(除了明显的可能)。
(编辑:加载的视图存储在可变字典中,以便在向后滚动时调用,并且它们是正确的)
I have implemented the UIScrollView with pagination, according to the PhotoScroller example.
However, I cannot get it to work nicely. I use an viewController which loads an XIB. But when scrolling the page does not actually update until it is complete in view (so it doesn't seem to render the layout with the data until it is completely in view)
I load the data on Loadview (as viewWillAppear never seems to be called in this scenario).
Any suggestions how I can have the whole view rendered when it is created so it shows while scrolling towards it? I am at a loss and think I tried almost everything (except the obvious probably).
(edit: the views that were loaded are stored in a mutable dictionary for recall when scrolling back, and they for correctly)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决这个问题的方法是实现示例应用程序,而不是在滚动开始时仅加载当前页面周围的页面,而是预加载周围的页面。这看起来很完美。
The way I solved it was to implement the example App and instead of only loading the pages around the current page when scrolling starts, to preload the pages around. That seems to work perfect.