滑动即可更改 UIViewContent
大家好,
我的应用程序中有一个 UIView,并且想要实现某种滑动手势。我知道如何检测这个手势(touchesBegan:和touchesEnded:例如x坐标距离超过100像素或其他),但我现在真的不知道如何动画化我的需求。事实上,我的 UIView 将包含 9 个 UIButtons 子视图。滑动时我想以编程方式更改按钮组...有什么解决方案吗?主要需要动画!
编辑:我考虑过以编程方式将按钮从屏幕移到左侧,同时将新按钮从右侧移到屏幕上。但似乎我真的不知道如何实现这一点......同时泄漏太多了吗?请给我提示!
Hej folks,
I got an UIView in my application and want to implement kind of a swipe gesture. I know how I detect this gesture (touchesBegan: and touchesEnded: for example is x coordinates are distanced more than 100 pixels or something else) but I really don´t now how to animate my needs. In fact my UIView will contain subviews which are 9 UIButtons. On swipe I want to change the set of buttons programatically...any solutions out there? Primarily need the animation!
EDIT: I thought about programatically moving the buttons off-screen to the left and at the same time move the new ones on-screen from the right side. But it seems I don't really know how to realize this...isn't it too much leaking at the same time? Please give me a hint!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么在检测到滑动手势后不加载窗口中设置的其他按钮的新视图?
why you don't load just a new view with the other button set in your window after the swipe gesture was detected?
看来您想重新创建类似跳板之类的东西,但使用按钮而不是图标。
我建议你使用 UIScrollView。
It's seem that you want to recreate somethings like the springboard but with button instead of icon.
I can suggest you to use UIScrollView.