滑动即可更改 UIViewContent

发布于 2024-09-19 23:09:44 字数 282 浏览 6 评论 0原文

大家好,

我的应用程序中有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猥琐帝 2024-09-26 23:10:18

为什么在检测到滑动手势后不加载窗口中设置的其他按钮的新视图?

why you don't load just a new view with the other button set in your window after the swipe gesture was detected?

走走停停 2024-09-26 23:10:12

看来您想重新创建类似跳板之类的东西,但使用按钮而不是图标。
我建议你使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文