如何实现循环滚动机制?
我有一些图像,用户应该从中选择一张。 现在我不想只提供带有无聊网格的平面滚动区域。 相反,我想显示一个包含这些图像的轮子。 顶部将有一个指示选择的标记。 类似于 Pickers 的东西。
问题不在于轮换,而在于轮换。 我会为此使用一些几何函数。 但我不知道如何真正获得滚轮上的滚动手势。 我必须从哪里开始?
顺便说一句:我所说的循环并不是指像 Pickers 这样的东西。 我的意思是一个有中心轴并且可以滚动的真正的轮子。 就像非常古老的电话,就像自行车车轮。 或者将拾取器旋转 90°,使轴面向您(Z 坐标)。
I'm having some images from which the user should choose one. Now I don't want to just offer an flat scrolling area with a boring grid. Instead, I'd like to show up a wheel that contains those images. At the top would be a marker indicating the selection. Something similar to the Pickers.
The problem is not the rotation stuff; I'd use some geometric functions for that. But I have no idea how to actually get the scrolling gestures on that wheel. Where must I start?
BTW: With circular I don't mean something like the Pickers. I mean a real wheel that has a center axis and can be rolled. Like the very old telephones, like a bike wheel. Or a Picker turned by 90°, facing with the axis to you (Z-coordinate).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在谈论捕获手势,那么这里是 他们在文档中给出的示例。
虽然我可以发誓我听到 Alan Cannistraro 在第一个 CS193P 中说讲座说你不必这样做,你可以捕获滑动事件,但我找不到。
是否有人真正知道自己在做什么,请纠正我,我将删除这篇文章,但现在我知道这会起作用:
If you're talking about capturing gestures then here is the example they give in the docs.
Though I could have sworn I heard Alan Cannistraro say in one of the first CS193P lectures that you don't have to do this, that you can just trap the swipe event but I can't find that.
Could someone that actually knows what they are doing please correct me and I'll remove this post but for now I know this will work:
您认为与选择器视图有多相似? 您可以使用自己的自定义子视图(可以是图像视图)加载选择器视图。 这将为您提供带有图像的实际选择器视图,这可能是也可能不是您的实际目标。
Just how similar to a picker view are you thinking? You can load up a picker view with your own custom subviews, which could be image views. That'd get you an actual picker view with your images, which might or might not be what you're actually aiming for.