自定义选择机制
我正在尝试创建一个小滑块机制,它作为一个盒子/视图运行,中间有一个静态线图像,后面是引脚。这些别针看起来就像尺子上的标记。当您向左或向右滑动标记时;它们不断地出现(循环)。我需要将其用作视图的控制器,就像选择器一样。它所需要做的就是在滑动引脚时滚动列表。我怎样才能把它放在一起?
I'm trying to create a little slider mechanism which operates as a box/view with a static line image in the center and behind it are pins. The pins look like marks on a ruler. When you slide the marks to the left or right; they keep coming continuously (a loop). And I need to use this as a controller of a view, like a selector. All it needs to do is scroll through a list when the pins are slid. How can I put this together?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个 UIView 并向其添加 UISwipeGestureRecogniser。当滑动发生时,更新 ivar 并重绘或为一堆重复的 UIimageView 子视图设置动画。
后者对于效率和平稳性来说更可取。
Create a UIView and add a UISwipeGestureRecogniser to it. When the swipe occurs update a ivar and either redraw or animate a bunch of repeating UIimageView subviews.
The latter will be preferable for efficiency and smoothness.