UIPickerView selectRow:inComponent:animated 具有平滑的动画
我试图创建一个老虎机(输入老虎机,但你可以说在 UI 级别它会像老虎机一样工作)所以我使用 UIPickerView
以及我如何使其循环。但是当我使用带有动画值 YES
的函数 selectRow:inComponent:animated:
旋转它时。它的动画有点马虎,或者你可以说当我们用手旋转 UIpickerview
时它不够酷。
动画马虎意味着,当我们用手移动 UIPickerView
时,它会在动画结束时降低速度,这种效果看起来非常好,但是当我使用函数 selectRow:inComponent:animated:
我无法获取该动画。
有没有办法得到这个动画???
i was trying to create a Slot machine(type off slot machine but you can say at UI level it will work like Slot machine) So I use UIPickerView
and some how i made it circular. But when i rotate it using function selectRow:inComponent:animated:
with animated value YES
. its animation is bit sloppy or you can say that not cool enough when we spin UIpickerview
from hands.
Sloppy animation means, when we move UIPickerView
with hands, it decreases its speed at the end of animation and this effect looks very good but when I use function selectRow:inComponent:animated:
I can't get that animation.
Is there a way to get that animation???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试获取 uipickerview 的递归描述?
我认为有些地方应该有一个滚动视图。
尝试获取滚动视图引用并使其使用自定义动画滚动到所需的位置。要获取视图层次结构,请尝试在选择器视图上使用递归描述。
这只是一个提示。
希望这有帮助。
Did you try getting the recursive description the uipickerview?
I think that some where there should be a scrollview inside.
try getting the scrollview reference and make it scroll to the desired position with a custom animation. To get the view hierarchy try using recursive description on the picker view.
It's just a hint.
Hope that this helps.
不确定它是否仍然相关,但当我偶然发现同样的问题时,我为 UIPickerView 做了一个扩展,并伪造了缓慢的动画。
Not sure if it is still relevant but as I stumbled on the same issue I made an extension for the UIPickerView with fakes the slow animation.