创建全向滚动视图
我想创建一个全向滚动视图,其工作方式与“Wall of Sound”应用程序中的滚动视图非常相似。就像这样,用户应该能够向任何方向拉动并且永远不会到达终点。我希望保持移动顺利(并且不会像在标准滚动视图中那样看到页面发生变化)。有谁知道如何做到这一点?或者我需要OpenGL吗?
I want to create an omnidirectional scrollview that works pretty much like the one in the "Wall of Sound" app. As in, the user should be able to pull into any direction and never get to an end. I want to keep the move to be smooth (and not see the pages change as you would in a standard scrollview). Does anyone know how that can be done? Or would I need OpenGL for that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个 3x3 的视图网格,每个视图的大小都是视口的大小。当滚动视图移动到另一个部分时,重新排列视图以不断将视口置于中心。在大多数情况下,3x3 就足够了,但如果重新绘制视图的成本很高,您可能需要使用更大的网格(例如 5x5)。这要求您有某种机制将完整视图分割成图块。
如果您愿意,您可以使用 CALayer 实现相同的功能。如果您这样做,您应该考虑使用
CATiledLayer
。请参阅 Matt Long 在 CIMGF 上的快速介绍。Create a 3x3 grid of views, each the size of the viewport. As the scrollview moves into another section, rearrange the views to constantly put the viewport in the center. In most cases 3x3 is sufficient, but if redrawing the views is expensive, you may want to use a larger grid (5x5 for instance). This requires that you have some mechanism for splitting up your full view into tiles.
You can implement the same thing using
CALayer
if you like. If you go that way, you should consider instead usingCATiledLayer
. See Matt Long's quick introduction on CIMGF.