看到很多关于创建 float 按钮的问题,效果很好。但是是否可以拖动按钮以便用户可以将其放在他想要的任何地方?
如果有人使用过“flipkart”应用程序,您可以看到“ping”按钮。这就是我要找的东西。有人有什么想法吗?
提前致谢
最佳答案
是的,您可以在 iOS 中拖动 UIButtons 和 UIViews。以下是我在谷歌搜索“拖动 uibutton ios”时发现的一些解释方法的帖子:
how to make UIbutton draggable within UIView?
Touch and drag a UIButton around, but don't trigger it when releasing the finger
如果你想在重新启动应用程序时保存它被用户拖动到的位置,那么使用 NSUserDefaults。
关于ios - 可以拖动到 View Controller 中任何位置的 float 按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33431189/