ScrollView 中 UIButton 的动画
我将“n”个 UIButtons 渲染到 ScrollView 中。我已经对 UIButton 进行了子类化以处理长按。
UIButton 的类型为“自定义”,仅显示文档目录中的 150px x 150 PC 图像。
如果用户在其中一个 UIButton 上点击时间较长,右上角会出现一个红十字,允许他从视图中删除所选的 UIButton。
这是我的问题:
我需要稍微动画一下删除操作。我想要的是淡出所选的 UIButton 并将已删除的 UIbutton 右侧的 UIbutton 向左移动一个位置(动画)。
我在网上学习了几个动画教程,但我不知道如何在这种情况下淡入/淡出 UIButton 或为它们设置动画。
I render "n" UIButtons into a ScrollView. I've subclassed the UIButton to handle long taps.
The UIButtons are of type "custom" and display only a 150px x 150 PC image from Documents Directory.
If the user taps longer on one of the UIButtons a red cross comes up on the upper right corner to allow him to delete the selected UIButton from view.
And here is my problem:
I need to animate the deletion a bit. What I want is to fade out the selected UIButton and move the UIbuttons on the right of the deleted UIbutton one position to the left (animated).
I worked through several animation tutorials on the web, but i don't know how to fade in/out a UIButton or animate them in this scenario.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅举一个如何淡出控件的示例:
在提交动画之前将其他按钮的框架更改到新位置。
希望有帮助。
Just an example of how to fade out a control:
Change the frame of the other buttons to the new location before commiting the animation.
Hope it helps.